Package org.jaxen.util
Class SingleObjectIterator
java.lang.Object
org.jaxen.util.SingleObjectIterator
- All Implemented Interfaces:
Iterator
- Direct Known Subclasses:
SelfAxisIterator
Simple utility class that wraps an iterator around one object.
This is a little more efficent than creating a one-object list.
-
Constructor Details
-
SingleObjectIterator
Creates a new single object iterator.- Parameters:
object
- the object to iterate over
-
-
Method Details
-
hasNext
public boolean hasNext()Returns true if this iterator's element has not yet been seen; false if it has. -
next
Returns the single element in this iterator if it has not yet been seen.- Specified by:
next
in interfaceIterator
- Returns:
- the next element in this iterator
- Throws:
NoSuchElementException
- if the element has already been seen- See Also:
-
remove
public void remove()This operation is not supported.- Specified by:
remove
in interfaceIterator
- Throws:
UnsupportedOperationException
- always
-