java.lang.Object | |
↳ | org.apache.commons.collections.iterators.SingletonListIterator |
SingletonIterator
is an ListIterator over a single
object instance.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
SingletonListIterator . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add always throws
UnsupportedOperationException . | |||||||||||
Is another object available from the iterator?
This returns true if the single object hasn't been returned yet. | |||||||||||
Is a previous object available from the iterator?
This returns true if the single object has been returned. | |||||||||||
Get the next object from the iterator.
| |||||||||||
Returns the index of the element that would be returned by a subsequent
call to next.
| |||||||||||
Get the previous object from the iterator.
| |||||||||||
Returns the index of the element that would be returned by a subsequent
call to previous.
| |||||||||||
Remove the object from this iterator.
| |||||||||||
Reset the iterator back to the start.
| |||||||||||
Set sets the value of the singleton.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Iterator
| |||||||||||
From interface
java.util.ListIterator
| |||||||||||
From interface
org.apache.commons.collections.ResettableIterator
| |||||||||||
From interface
org.apache.commons.collections.ResettableListIterator
|
Constructs a new SingletonListIterator
.
object | the single object to return from the iterator |
---|
Add always throws UnsupportedOperationException
.
UnsupportedOperationException | always |
---|
Is another object available from the iterator?
This returns true if the single object hasn't been returned yet.
Is a previous object available from the iterator?
This returns true if the single object has been returned.
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 |
---|
Returns the index of the element that would be returned by a subsequent call to next.
Get the previous object from the iterator.
This returns the single object if it has been returned.
NoSuchElementException | if the single object has not already been returned |
---|
Returns the index of the element that would be returned by a subsequent call to previous. A return value of -1 indicates that the iterator is currently at the start.
Remove the object from this iterator.
IllegalStateException | if the next or previous method has not yet been called, or the remove method has already been called after the last call to next or previous. |
---|
Reset the iterator back to the start.
Set sets the value of the singleton.
obj | the object to set |
---|
IllegalStateException | if next has not been called or the object has been removed |
---|