Examples of Node


Examples of org.openpixi.pixi.distributed.Node

      simulation.run();
      ProfileInfo.printProfileInfo();
    }
    else if (numOfNodes > 1) {
      assert iplServer != null;
      Node node = new Node(settings);
      node.run();
      DistributedProfileInfo.printProfileInfo();
    }

    settings.terminateThreads();
  }

Examples of org.openquark.cal.internal.machine.g.Node

    public Node doEvaluation (Node[] arguments, Executor executor)
            throws CALExecutorException {
      
        // Evaluate the 3 arguments.
        NRecordValue recordDictionary = (NRecordValue) executor.internalEvaluate(arguments[0]);
        Node genParams = executor.internalEvaluate(arguments[1]);
        Node independent = executor.internalEvaluate(arguments[2]);
       
        NValInt arbitraryMethodIndex = getIndexOfGenerateClassMethod(executor);
      
        List<String> fieldNames = recordDictionary.fieldNames();
        final int nFields = fieldNames.size();

        NRecordValue result=new NRecordValue(nFields);

        /*
         * Loops through all fields in the record dictionary and
         * invokes the arbitrary class method to
         * construct each record field
         */
        for (int i = 0; i < nFields; ++i) {
            genParams=executor.internalEvaluate(independent.apply( new NValInt(i)).apply(genParams));
           
            String fieldName = fieldNames.get(i);
            Node valueDictionaryThunk = recordDictionary.getValue(fieldName);
           
            result= result.insertRecordField(fieldName,
                executor.internalEvaluate(valueDictionaryThunk.apply(arbitraryMethodIndex).apply(genParams)));
        }
       
        return result;
    }

Examples of org.openrdf.query.parser.serql.ast.Node

    // Iterate over all projection elements to retrieve the defined aliases
    Set<String> aliases = new HashSet<String>();
    List<Node> unaliasedNodes = new ArrayList<Node>();

    for (int i = 0; i < node.jjtGetNumChildren(); i++) {
      Node projElem = node.jjtGetChild(i);

      assert projElem instanceof ASTProjectionElem : "child node is not a projection element";

      Object result = projElem.jjtAccept(this, aliases);

      if (result instanceof String) {
        String alias = (String)result;

        boolean isUnique = aliases.add(alias);

        if (!isUnique) {
          throw new VisitorException("Duplicate projection element aliases: '" + alias + "'");
        }
      }
      else {
        unaliasedNodes.add(projElem);
      }
    }

    // Iterate over the unaliased nodes and generate aliases for them
    int aliasNo = 1;
    for (Node projElem : unaliasedNodes) {
      Node exprNode = projElem.jjtGetChild(0);

      if (exprNode instanceof ASTVar) {
        String varName = ((ASTVar)exprNode).getName();
       
        if (!aliases.contains(varName)) {

Examples of org.openrdf.query.parser.sparql.ast.Node

    URI functionURI = (URI)uriNode.getValue();

    FunctionCall functionCall = new FunctionCall(functionURI.toString());

    for (int i = 1; i < node.jjtGetNumChildren(); i++) {
      Node argNode = node.jjtGetChild(i);
      functionCall.addArg((ValueExpr)argNode.jjtAccept(this, null));
    }

    return functionCall;
  }

Examples of org.openstreetmap.josm.data.osm.Node

                  + numeros.length);
            else {
              try {
                LatLon latlon = extractLatLon(numeros);
                log.trace(latlon);
                Node n = new Node(id++);
                n.setCoor(latlon);
                ((Way) resultado).addNode(n);
              } catch (Exception e) {
                log.error("Error calculando el nodo", e);
              }
            }
          }
        }
        break;
      case POINT:
        log.trace("Reconocido a POINT");
        if (componentes[1].length() < 1) {
          log.error("componentes erroneas");
        } else {
          String coordenada = componentes[1].substring(0,
              componentes[1].length() - 1);
          if (coordenada.length() == 0)
            log.trace("No hay coordenadas, ¿geometria vacia?");
          log.trace("coordenadas: " + coordenada);
          String[] numeros = StringUtils.split(coordenada, " ");
          if (numeros.length != 2)
            log.error("Numero de dimensiones incorrecto: "
                + numeros.length);
          else {
            try {
              LatLon latlon = extractLatLon(numeros);
              resultado = new Node(latlon);
            } catch (Exception e) {
              log.error("Error calculando el nodo", e);
              e.printStackTrace();
            }
          }

Examples of org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Node

            l.setWeight(1.0 / numPanels);
            ch.add(l);
        }

        if (numPanels == 1) {
            Node model = ch.get(0);
            mSpltPane.getMultiSplitLayout().setModel(model);
        } else {
            Split model = new Split();
            model.setRowLayout(false);
            model.setChildren(ch);
            mSpltPane.getMultiSplitLayout().setModel(model);
        }

        mSpltPane.getMultiSplitLayout().setDividerSize(DIVIDER_SIZE);
        mSpltPane.getMultiSplitLayout().setFloatingDividers(true);

Examples of org.openstreetmap.osmosis.core.domain.v0_6.Node

    for (Way way : waysById.values()) {
     
      List<WayNode> origWayNodes = way.getWayNodes();
      List<OSMNode> wayNodes = new ArrayList<OSMNode>(origWayNodes.size());
      for (WayNode origWayNode : origWayNodes) {
        Node origNode = nodesById.get(origWayNode.getNodeId());
        if (origNode != null) {
          wayNodes.add(nodeMap.get(origNode));
        }
      }
     

Examples of org.outerj.daisy.diff.html.dom.Node

    List<Node> deletedNodes = oldComp.getBodyNode().getMinimalDeletedSet(
        deletedID);

    // Set prevLeaf to the leaf after which the old HTML needs to be
    // inserted
    Node prevLeaf = null;
    if (before > 0)
      prevLeaf = getTextNode(before - 1);

    // Set nextLeaf to the leaf before which the old HTML needs to be
    // inserted
    Node nextLeaf = null;
    if (before < getRangeCount())
      nextLeaf = getTextNode(before);

    while (deletedNodes.size() > 0) {
      LastCommonParentResult prevResult, nextResult;
      if (prevLeaf != null) {
        prevResult = prevLeaf.getLastCommonParent(deletedNodes.get(0));
      } else {
        prevResult = new LastCommonParentResult();
        prevResult.setLastCommonParent(getBodyNode());
        prevResult.setIndexInLastCommonParent(-1);
      }
      if (nextLeaf != null) {
        nextResult = nextLeaf.getLastCommonParent(deletedNodes
            .get(deletedNodes.size() - 1));
      } else {
        nextResult = new LastCommonParentResult();
        nextResult.setLastCommonParent(getBodyNode());
        nextResult.setIndexInLastCommonParent(getBodyNode()
            .getNbChildren());
      }

      if (prevResult.getLastCommonParentDepth() == nextResult
          .getLastCommonParentDepth()) {
        // We need some metric to choose which way to add...
        if (deletedNodes.get(0).getParent() == deletedNodes.get(
            deletedNodes.size() - 1).getParent()
            && prevResult.getLastCommonParent() == nextResult
                .getLastCommonParent()) {
          // The difference is not in the parent
          prevResult.setLastCommonParentDepth(prevResult
              .getLastCommonParentDepth() + 1);

        } else {
          // The difference is in the parent, so compare them
          // now THIS is tricky
          double distancePrev = deletedNodes.get(0).getParent()
              .getMatchRatio(prevResult.getLastCommonParent());
          double distanceNext = deletedNodes.get(
              deletedNodes.size() - 1).getParent().getMatchRatio(
              nextResult.getLastCommonParent());

          if (distancePrev <= distanceNext) {
            // insert after the previous node
            prevResult.setLastCommonParentDepth(prevResult
                .getLastCommonParentDepth() + 1);
          } else {
            // insert before the next node
            nextResult.setLastCommonParentDepth(nextResult
                .getLastCommonParentDepth() + 1);
          }
        }

      }

      if (prevResult.getLastCommonParentDepth() > nextResult
          .getLastCommonParentDepth()) {
     
        // Inserting at the front
        if(inlineResult) {
          if (prevResult.isSplittingNeeded()) {
            prevLeaf.getParent().splitUntill(
            prevResult.getLastCommonParent(), prevLeaf, true);
          }
          prevLeaf = deletedNodes.remove(0).copyTree();
          prevLeaf.setParent(prevResult.getLastCommonParent());
          prevResult.getLastCommonParent().addChild(
            prevResult.getIndexInLastCommonParent() + 1,
            prevLeaf);
        } else {
          deletedNodes.remove(0);
        }

      } else if (prevResult.getLastCommonParentDepth() < nextResult
          .getLastCommonParentDepth()) {
        // Inserting at the back
        if (nextResult.isSplittingNeeded()) {
          boolean splitOccured = nextLeaf.getParent().splitUntill(
              nextResult.getLastCommonParent(), nextLeaf, false);

          if (splitOccured) {
            // The place where to insert is shifted one place to the
            // right
            nextResult.setIndexInLastCommonParent(nextResult
                .getIndexInLastCommonParent() + 1);
          }
        }
        if(inlineResult) {
          nextLeaf = deletedNodes.remove(deletedNodes.size() - 1)
            .copyTree();
          nextLeaf.setParent(nextResult.getLastCommonParent());
          nextResult.getLastCommonParent().addChild(
              nextResult.getIndexInLastCommonParent(), nextLeaf);
        } else {
          deletedNodes.remove(deletedNodes.size() - 1);
        }

Examples of org.patika.mada.graph.Node

  {
    LinkedList<Node> tempNodeList = new LinkedList<Node>();

    for (Node node : nodes)
    {
      Node n = (Node) graph.getCorrespMember(node);
      assert n != null;
      tempNodeList.add(n);
    }
    nodes = tempNodeList;

Examples of org.pegdown.ast.Node

            RootNode rootNode = PEGDOWN_PROCESSOR.parseMarkdown( text.toCharArray() );
            if ( !haveTitle && rootNode.getChildren().size() > 0 )
            {
                // use the first (non-comment) node only if it is a heading
                int i = 0;
                Node firstNode = null;
                while ( i < rootNode.getChildren().size() && isHtmlComment(
                    ( firstNode = rootNode.getChildren().get( i ) ) ) )
                {
                    i++;
                }
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.