java.lang.Object | |
↳ | org.apache.commons.collections.iterators.SingletonIterator |
SingletonIterator
is an Iterator over a single
object instance.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
SingletonIterator where remove
is a permitted operation. | |||||||||||
Constructs a new
SingletonIterator optionally choosing if
remove is a permitted operation. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Is another object available from the iterator?
This returns true if the single object hasn't been returned yet. | |||||||||||
Get the next object from the iterator.
| |||||||||||
Remove the object from this iterator.
| |||||||||||
Reset the iterator to the start.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a new SingletonIterator
where remove
is a permitted operation.
object | the single object to return from the iterator |
---|
Constructs a new SingletonIterator
optionally choosing if
remove
is a permitted operation.
object | the single object to return from the iterator |
---|---|
removeAllowed | true if remove is allowed |
Is another object available from the iterator?
This returns true if the single object hasn't been returned yet.
Get the next object from the iterator.
This returns the single object if it hasn't been returned yet.
NoSuchElementException | if the single object has already been returned |
---|
Remove the object from this iterator.
IllegalStateException | if the next method has not yet been called, or the remove method has already been called after the last call to the next method. |
---|---|
UnsupportedOperationException | if remove is not supported |
Reset the iterator to the start.