Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.phoenixst.plexus
Class GraphUtils.SingletonTraverser  view GraphUtils.SingletonTraverser download GraphUtils.SingletonTraverser.java

java.lang.Object
  extended bycom.phoenixst.plexus.GraphUtils.SingletonTraverser
All Implemented Interfaces:
java.util.Iterator, java.io.Serializable, Traverser
Enclosing class:
GraphUtils

private static class GraphUtils.SingletonTraverser
extends java.lang.Object
implements Traverser, java.io.Serializable


Field Summary
private  Graph.Edge edge
           
private  java.lang.Object endpoint
           
private  Graph graph
           
private  boolean hasEndpoint
           
private  boolean hasNext
           
private  java.lang.Object otherEndpoint
           
 
Constructor Summary
private GraphUtils.SingletonTraverser(Graph graph, Graph.Edge edge, java.lang.Object endpoint)
           
 
Method Summary
 Graph.Edge getEdge()
          Returns the Edge which was traversed to get to the last node returned by next() 55 .
 java.lang.Object getOtherEndpoint()
          Returns the node at the other end of the edge which was traversed to get to the last node returned by next() 55 .
 boolean hasNext()
          Tests whether there are elements remaining in the collection.
 java.lang.Object next()
          Obtain the next element in the collection.
 void remove()
          Remove from the underlying collection the last element returned by next (optional operation).
 void removeEdge()
          Removes from the underlying Graph the Edge that would be returned by getEdge() 55 (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

private Graph graph

edge

private Graph.Edge edge

endpoint

private java.lang.Object endpoint

otherEndpoint

private java.lang.Object otherEndpoint

hasNext

private boolean hasNext

hasEndpoint

private boolean hasEndpoint
Constructor Detail

GraphUtils.SingletonTraverser

private GraphUtils.SingletonTraverser(Graph graph,
                                      Graph.Edge edge,
                                      java.lang.Object endpoint)
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: java.util.Iterator
Tests whether there are elements remaining in the collection. In other words, calling next() will not throw an exception.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Description copied from interface: java.util.Iterator
Obtain the next element in the collection.

Specified by:
next in interface java.util.Iterator

remove

public void remove()
Description copied from interface: java.util.Iterator
Remove from the underlying collection the last element returned by next (optional operation). This method can be called only once after each call to next(). It does not affect what will be returned by subsequent calls to next.

Specified by:
remove in interface java.util.Iterator

getEdge

public Graph.Edge getEdge()
Description copied from interface: Traverser
Returns the Edge which was traversed to get to the last node returned by Iterator.next()>Iterator.next() 55 . If no edge was traversed (as in the root of a breadth first search), this method throws a NoSuchElementException. This call can be made only if Iterator.remove()>Iterator.remove() 55 or Traverser.removeEdge() 55 has not been called after the last call to Iterator.next()>Iterator.next() 55 .

Specified by:
getEdge in interface Traverser

removeEdge

public void removeEdge()
Description copied from interface: Traverser
Removes from the underlying Graph the Edge that would be returned by Traverser.getEdge() 55 (optional operation). If no edge was traversed (as in the root of a breadth first search), this method throws a NoSuchElementException. This method can be called only once per call to Iterator.next()>Iterator.next() 55 . The behavior of a traverser is unspecified if the underlying graph structure is modified while the traversal is in progress in any way other than by calling this method or Iterator.remove()>Iterator.remove() 55 .

Specified by:
removeEdge in interface Traverser

getOtherEndpoint

public java.lang.Object getOtherEndpoint()
Description copied from interface: Traverser
Returns the node at the other end of the edge which was traversed to get to the last node returned by Iterator.next()>Iterator.next() 55 . If no edge was traversed (as in the root of a breadth first search), this method throws a NoSuchElementException. This call can be made only if Iterator.remove()>Iterator.remove() 55 or Traverser.removeEdge() 55 has not been called after the last call to Iterator.next()>Iterator.next() 55 .

Specified by:
getOtherEndpoint in interface Traverser