class JdapiObjectLibraryObjectIterator extends java.lang.Object implements JdapiIterator
Modifier and Type | Field and Description |
---|---|
(package private) int |
m_lastPosition
Position of last element in list, cached here for performance.
|
(package private) ObjectLibrary |
m_olb
ObjectLibrary whose objects this is an iterator for.
|
(package private) int |
m_position
Current position in the list of objects.
|
Modifier | Constructor and Description |
---|---|
protected |
JdapiObjectLibraryObjectIterator(ObjectLibrary olb)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
goLast()
Moves the iterator to the end of the list.
|
void |
goStart()
Moves the iterator to the start of the list.
|
boolean |
hasNext()
Returns true if the iteration has more elements (JDK1.2 iterator
style).
|
boolean |
hasPrevious()
Returns true if the iteration has previous elements (JDK1.2 list
iterator style).
|
java.lang.Object |
next()
Gets the next object (JDK1.2 iterator style).
|
java.lang.Object |
previous()
Gets the previous object (JDK1.2 list iterator style).
|
void |
remove()
Removes the current object from the iteration.
|
ObjectLibrary m_olb
int m_position
int m_lastPosition
protected JdapiObjectLibraryObjectIterator(ObjectLibrary olb)
olb
- ObjectLibrary to iterate overpublic void goLast()
goLast
in interface JdapiIterator
public void goStart()
goStart
in interface JdapiIterator
public boolean hasNext()
hasNext
in interface java.util.Iterator
hasNext
in interface JdapiIterator
public boolean hasPrevious()
hasPrevious
in interface JdapiIterator
public java.lang.Object next()
next
in interface java.util.Iterator
next
in interface JdapiIterator
public java.lang.Object previous()
previous
in interface JdapiIterator
public void remove()
If the iterator is not positioned at the first element of the list, it will position itself there before doing the remove. This allows you to write code like:
while(iter.hasNext()) { iter.remove(); }
remove
in interface java.util.Iterator
remove
in interface JdapiIterator