Examples of NodeSequence


Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

    // Sequence, stepping back along the path until we find the Vertex
    // that closed the cycle.
    //
    // If no cycle is found, the Sequence will be empty and the cycle
    // Iterator will be empty
    Sequence theCycle = new NodeSequence();
    ObjectIterator pathVerts = prospectiveCycle_.elements();
    while (pathVerts.hasNext()) {
      Vertex v = (Vertex)pathVerts.nextObject();
      theCycle.insertFirst(v);
      if (v == cycleStart_) {
  break;
      }
    }
    // remove all decorations added during the DFS
    cleanup();
    // get ready to return the cycle.
    cycleIterator_ = theCycle.elements();
  }
View Full Code Here

Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

  /**
   * Simple constructor initializes instance variables.
   */
  public FindCycleDFS() {
    prospectiveCycle_ = new NodeSequence();
    done_ = false;
  }
View Full Code Here

Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

    // Sequence, stepping back along the path until we find the Vertex
    // that closed the cycle.
    //
    // If no cycle is found, the Sequence will be empty and the cycle
    // Iterator will be empty
    Sequence theCycle = new NodeSequence();
    ObjectIterator pathVerts = prospectiveCycle_.elements();
    while (pathVerts.hasNext()) {
      Vertex v = (Vertex)pathVerts.nextObject();
      theCycle.insertFirst(v);
      if (v == cycleStart_) {
  break;
      }
    }
    // remove all decorations added during the DFS
    cleanup();
    // get ready to return the cycle.
    cycleIterator_ = theCycle.elements();
  }
View Full Code Here

Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

     * <p>
     * O(1)
     */
    public IncidenceListGraph() {
        super();
        allverts_ = new NodeSequence();
        alledges_ = new NodeSequence();
    }
View Full Code Here

Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

    * @exception InvalidEdgeException if an undirected Edge is found
    */
  protected void init(InspectableGraph g) throws InvalidEdgeException{
    graph_ = g;
    NUMBER_KEY_ = new Object();
    queue_ = new NodeSequence();

    //make sure all edges are directed
    EdgeIterator ei = graph_.edges();
    while (ei.hasNext()){
      Edge e = ei.nextEdge();
View Full Code Here

Examples of nz.ac.waikato.jdsl.core.ref.NodeSequence

  public EdgeIterator reportPath () throws InvalidQueryException {
    if (!pathExists())
      throw new InvalidQueryException("No path exists between "+source_
              +" and "+dest_);
    else {
      Sequence retval = new NodeSequence();
      Vertex currVertex = dest_;
      while (currVertex != source_) {
  assert isFinished(currVertex);
  Edge currEdge = getEdgeToParent(currVertex);
  assert currEdge != null;
  retval.insertFirst(currEdge);
  currVertex = g_.opposite(currVertex,currEdge);
      }
      return new EdgeIteratorAdapter(retval.elements());
    }
  }
View Full Code Here

Examples of org.apache.jackrabbit.commons.flat.NodeSequence

    }

    public void testEmptyNodeSequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        Iterator<Node> nodeIt = nodes.iterator();
        assertTrue(nodeIt.hasNext());
        assertTrue(treeManager.isRoot(nodeIt.next()));
        assertFalse(nodeIt.hasNext());

        checkTreeProperty(testNode, 5, 10, order);
View Full Code Here

Examples of org.apache.jackrabbit.commons.flat.NodeSequence

    }

    public void testSingletonNodeSequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        nodes.addNode("key", NodeType.NT_UNSTRUCTURED);
        assertTrue(nodes.hasItem("key"));

        Iterator<Node> nodeIt = nodes.iterator();
        assertTrue(nodeIt.hasNext());
        assertEquals("key", nodeIt.next().getName());
        assertFalse(nodeIt.hasNext());

        checkTreeProperty(testNode, 5, 10, order);
        checkOrder(nodes, order);

        nodes.removeNode("key");
        assertEmpty(nodes);
    }
View Full Code Here

Examples of org.apache.jackrabbit.commons.flat.NodeSequence

    }

    public void testNodeSequence() throws RepositoryException, IOException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        List<String> words = loadWords();
        Collections.shuffle(words);

        addAll(nodes, words);
View Full Code Here

Examples of org.jboss.seam.remoting.annotationparser.syntaxtree.NodeSequence

      NodeOptional n = (NodeOptional) node.f0;
      if (n.present())
      {
         if (n.node instanceof NodeSequence)
         {
            NodeSequence ns = (NodeSequence) n.node;
            {
               for (Node nsNode : ns.nodes)
               {
                  if (nsNode instanceof org.jboss.seam.remoting.annotationparser.syntaxtree.Annotation)
                  {
View Full Code Here
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.