All Packages Class Hierarchy This Package Previous Next Index
Interface com.roguewave.tools.v2-0.BidirectionalEnumeration
- public interface BidirectionalEnumeration
- extends Enumeration
This interface extends Enumeration to allow you to move both
forwards and backwards within a collection.
An object implementing this interface should always be thought
of as positioned between two elements of the collection,
just before the first element, or just past the last element.
A call to nextElement() or previousElement()
always returns the element that is "passed over" by the enumerator
on the way to its subsequent position.
Thus a call to nextElement()
followed immediately by a call to previousElement() will
both return the same element of the collection.
-
hasPriorElements()
- Returns true if there are any elements prior to the position
of the enumerator.
-
previousElement()
- Returns the element behind the current position of the enumerator.
-
setToEnd()
- Positions the enumerator just past the end
of the collection.
hasPriorElements
public abstract boolean hasPriorElements()
- Returns true if there are any elements prior to the position
of the enumerator.
Returns false if the enumerator is positioned just in front
of the first element or the collection is empty.
previousElement
public abstract Object previousElement()
- Returns the element behind the current position of the enumerator.
- Throws: NoSuchElementException
- if no prior elements exist
setToEnd
public abstract void setToEnd()
- Positions the enumerator just past the end
of the collection. A subsequent call to previousElement()
will return the last element of the collection (assuming, or course,
that the collection is not empty).
All Packages Class Hierarchy This Package Previous Next Index