edu.umd.cfar.lamp.viper.util
Interface CircularIterator

All Superinterfaces:
java.util.Iterator, java.util.ListIterator
All Known Implementing Classes:
AbstractCircularIterator

public interface CircularIterator
extends java.util.ListIterator

Enhanced ListIterator with methods for dealing with lists without ends.


Method Summary
 java.lang.Object current()
          Gets the last object returned by the last call to next or previous.
 boolean isEmpty()
          Tests to see if the collection the iterator refers to has no elements.
 
Methods inherited from interface java.util.ListIterator
add, hasNext, hasPrevious, next, nextIndex, previous, previousIndex, remove, set
 

Method Detail

current

public java.lang.Object current()
Gets the last object returned by the last call to next or previous. If the object has been removed, it should return null, with the pointer now between the adjacent elements.

Returns:

isEmpty

public boolean isEmpty()
Tests to see if the collection the iterator refers to has no elements. Note that either hasNext() and hasPrevious() will return the same thing.

Returns:
true when the iterator is iterating over an empty collection