Examples of Node


Examples of linkedlist.Node

public class DoubleLinkedList {
  private Node firstNode = null;

  public DoubleLinkedList(Object data) {
    firstNode = new Node(data);
  }

Examples of lombok.ast.Node

        Object nativeNode = node.getNativeNode();
        if (nativeNode != null) {
            return nativeNode;
        }

        Node parent = node.getParent();
        // The ECJ native nodes are sometimes spotty; for example, for a
        // MethodInvocation node we can have a null native node, but its
        // parent expression statement will point to the real MessageSend node
        if (parent != null) {
            nativeNode = parent.getNativeNode();
            if (nativeNode != null) {
                return nativeNode;
            }
        }

Examples of loop.ast.Node

    // Not all parts of the sexpr are lists.
    if (child instanceof InlineListDef) {
      InlineListDef list = (InlineListDef) child;

      if (!list.children().isEmpty()) {
        Node first = list.children().get(0);
        if (first instanceof Variable) {
          Variable var = (Variable) first;

          if ("define".equals(var.name)) {
            return transformToFunctionDecl(list);

Examples of lt.refactory.primsAlgo.graph.Node

public class PrimsControllerTest {

  @Test
  public void firstTest() {
    List<Node> nodeList = new ArrayList<Node>();
    nodeList.add(new Node(BigDecimal.valueOf(1), BigDecimal.valueOf(1)));
    nodeList.add(new Node(BigDecimal.valueOf(1), BigDecimal.valueOf(4)));
    nodeList.add(new Node(BigDecimal.valueOf(5), BigDecimal.valueOf(1)));
   
    Graph<Edge> graph = Graph.<Edge>fullGraphFactory(nodeList);
    Graph<WeightedEdge> weightedGraph = SteinersAlgorithm.getWeightedGraph(graph);

    PrimsController controller = new PrimsController(weightedGraph);
    weightedGraph = controller.getSmallestTreeWithOnePoint(weightedGraph);
   
    Node steinersPoint = weightedGraph.getSteinersPoint();
   
    assertTrue(steinersPoint != null);
    assertTrue(steinersPoint.getPointX().compareTo(BigDecimal.valueOf(1.6)) == 1);
    assertTrue(steinersPoint.getPointX().compareTo(BigDecimal.valueOf(1.8)) == -1);
   
    assertTrue(steinersPoint.getPointY().compareTo(BigDecimal.valueOf(1.7)) == 1);
    assertTrue(steinersPoint.getPointY().compareTo(BigDecimal.valueOf(1.8)) == -1);
  }

Examples of lupos.compression.huffman.tree.Node

    // store in current block
    this.block[this.current]=(byte)b;
    this.current++;
    if(this.current==HuffmanOutputStream.blocksize){
      // one block is complete!
      Node root = this.buildHuffmanTree();
      // encode huffeman tree and the block by using the built huffman tree
      encode(root);
      this.current=0;
    }   
  }

Examples of lupos.datastructures.patriciatrie.node.Node

        if (nodesToMerge.get(0) != this.getRootNode()) {
          System.err.println("Please do not use merge for one trie, use copy instead!");
          this.setRootNode(nodesToMerge.get(0)); // TODO Hier muss kopiert werden, nicht einfach der rootNode uebernommen
        }
      } else if (nodesToMerge.size() > 1) { // Only merge if there are at least 2 valid root nodes
        final Node root = this.createNodeInstance();

        this.mergeAfterCheck(root, nodesToMerge);

        this.changeRootNode(root);
      }

Examples of lupos.endpoint.client.formatreader.csv.Node

      if(root == null){
        return null;
      }
      final LinkedList<Variable> vars = new LinkedList<Variable>();
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTVars){
          for(int j=0; j<child.jjtGetNumChildren(); j++){
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTVar){
              vars.add(new Variable(((ASTVar)childchild).getName()));
            }
          }
        }
      }
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTOneResult){
          final Bindings bindings = bindingsFactory.createInstance();
          final Iterator<Variable> varIt = vars.iterator();
          for(int j=0; j<child.jjtGetNumChildren() && varIt.hasNext(); j++){
            final Variable var = varIt.next();
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTValue && childchild.jjtGetNumChildren()>0){
              bindings.add(var, CSVParser.getLiteral(childchild.jjtGetChild(0)));
            }
          }
          result.add(bindings);
        }
      }

Examples of lupos.endpoint.client.formatreader.tsv.Node

    try {
      final SimpleNode root = TSVParser.parse(inputStream);
      final LinkedList<Variable> vars = new LinkedList<Variable>();
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTVars){
          for(int j=0; j<child.jjtGetNumChildren(); j++){
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTVar){
              vars.add(new Variable(((ASTVar)childchild).getName()));
            }
          }
        }
      }
      for(int i=0; i<root.jjtGetNumChildren(); i++){
        final Node child = root.jjtGetChild(i);
        if(child instanceof ASTOneResult){
          final Bindings bindings = bindingsFactory.createInstance();
          final Iterator<Variable> varIt = vars.iterator();
          for(int j=0; j<child.jjtGetNumChildren() && varIt.hasNext(); j++){
            final Variable var = varIt.next();
            final Node childchild = child.jjtGetChild(j);
            if(childchild instanceof ASTValue && childchild.jjtGetNumChildren()>0){
              bindings.add(var, TSVParser.getLiteral(childchild.jjtGetChild(0)));
            }
          }
          result.add(bindings);
        }
      }

Examples of lupos.sparql1_1.Node

    // create list for SortContainers...
    final LinkedList<SortContainer> scl = new LinkedList<SortContainer>();

    // walk through children...
    for (int i = 0; i < node.jjtGetNumChildren(); ++i) {
      Node n = node.jjtGetChild(i); // get current child

      boolean desc = false; // set order ASC as default

      // current node is Order node...
      if (n instanceof ASTAscOrder || n instanceof ASTDescOrder) {
        if (n instanceof ASTDescOrder) // reset order value to DESC...
          desc = true;

        i++; // increase counter to get next child (which is sort
        // condition)
      }

      n = node.jjtGetChild(i); // get next child (which is sort condition)

      // parse node with the filter...
      final SPARQLParserVisitorImplementationDumper filterDumper = new SPARQLParserVisitorImplementationDumper();
      final String sortString = n.accept(filterDumper);

      try {
        final SortContainer sc = new SortContainer(this.prefix, desc,
            sortString); // create SortContainer

Examples of ma.glasnost.orika.impl.generator.Node

                    out.append(statement(destRef.newDestination.declareIterator()));
                }
                List<Node> children = new ArrayList<Node>();
                children.add(destRef);
                while (!children.isEmpty()) {
                    Node child = children.remove(0);
                    children.addAll(child.children);
                    if (child.elementRef != null) {
                        out.append(statement(child.elementRef.declare()));
                        if (child.multiOccurrenceVar.isArray()) {
                            out.append(statement(child.multiOccurrenceVar.declareIterator()));
                        }
                        if (child.elementRef.isPrimitive()) {
                            out.append(statement(child.nullCheckFlag.declare("true")));
                        }
                        out.append(statement(child.shouldAddToCollectorFlag.declare("false")));
                    }
                }
            }
        }
       
        // TODO: need to create a flag variable to mark whether destination has been added
        // to it's collector; it should be set to false upon new destination element creation
       
       
//        MapperFactory mapperFactory = (MapperFactory) code.getMappingContext().getProperty(Properties.MAPPER_FACTORY);
       
        StringBuilder endWhiles = new StringBuilder();
        StringBuilder addLastElement = new StringBuilder();
       
        iterateSources(sourceNodes, destNodes, out, endWhiles);
       
        LinkedList<Node> stack = new LinkedList<Node>(destNodes);
        while (!stack.isEmpty()) {
           
            Node currentNode = stack.removeFirst();
            stack.addAll(0, currentNode.children);
            Node srcNode = null;
            if (currentNode.value != null) {
                srcNode = Node.findFieldMap(currentNode.value, sourceNodes, true);
            } else {
                FieldMap fieldMap = currentNode.getMap();
                if (fieldMap != null) {
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.