cage
Class NativeEdgeIterator

java.lang.Object
  extended by cage.NativeEdgeIterator
All Implemented Interfaces:
EdgeIterator, java.util.Iterator

public class NativeEdgeIterator
extends java.lang.Object
implements EdgeIterator

Returned by a NativeEmbeddableGraph as an iterator over its edges.


Constructor Summary
NativeEdgeIterator()
           
 
Method Summary
protected  void finalize()
          Lets the native code run its finalization first and then just call super.finalize().
 boolean hasNext()
          Returns true if the iteration has more edges.
 java.lang.Object next()
          Returns the next edge in the iteration.
 int nextEdge()
          Returns the next edge in the iteration.
 void remove()
          Throws UnsupportedOperationException because edges can't be removed.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeEdgeIterator

public NativeEdgeIterator()
Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more edges. (In other words, returns true if next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Returns the next edge in the iteration. Calling this method repeatedly until the hasNext() method returns false will return each element in the underlying collection exactly once.

Specified by:
next in interface java.util.Iterator
Returns:
the next edge in the iteration as an MutableInteger.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

nextEdge

public int nextEdge()
             throws java.util.NoSuchElementException
Returns the next edge in the iteration. Calling this method repeatedly until the hasNext() method returns false will return each element in the underlying collection exactly once.

Specified by:
nextEdge in interface EdgeIterator
Returns:
the next edge in the iteration as an int.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Throws UnsupportedOperationException because edges can't be removed.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - if the remove operation is not supported by this Iterator.

finalize

protected void finalize()
                 throws java.lang.Throwable
Lets the native code run its finalization first and then just call super.finalize().

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable