org.apache.commons.collections.iterators
Class SingletonIterator
java.lang.Object
org.apache.commons.collections.iterators.SingletonIterator
- Iterator
public class SingletonIterator
extends java.lang.Object
implements Iterator
SingletonIterator
is an Iterator
over a single
object instance.
boolean | hasNext() - Is another object available from the iterator.
|
Object | next() - Get the next object from the iterator.
|
void | remove() - Remove always throws
UnsupportedOperationException .
|
SingletonIterator
public SingletonIterator(Object object)
Constructs a new SingletonIterator
.
object
- the single object to return from the iterator
hasNext
public boolean hasNext()
Is another object available from the iterator.
This returns true if the single object hasn't been returned yet.
- true if the single object hasn't been returned yet
next
public Object next()
Get the next object from the iterator.
This returns the single object if it hasn't been returned yet.
remove
public void remove()
Remove always throws UnsupportedOperationException
.
Copyright © 2001-2004 Apache Software Foundation. Documenation generated ${TODAY}.