class JdapiObjectLibraryTabObjectIterator 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) ObjectLibraryTab |
m_olt
ObjectLibraryTab who's object this is an iterator for.
|
(package private) int |
m_position
Current position in the list of objects.
|
Modifier | Constructor and Description |
---|---|
protected |
JdapiObjectLibraryTabObjectIterator(ObjectLibraryTab olt)
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.
|
ObjectLibraryTab m_olt
int m_position
int m_lastPosition
protected JdapiObjectLibraryTabObjectIterator(ObjectLibraryTab olt) throws JdapiException
olt
- ObjectLibraryTab to iterate overJdapiException
public 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() throws JdapiException
next
in interface java.util.Iterator
next
in interface JdapiIterator
JdapiException
public java.lang.Object previous() throws JdapiException
previous
in interface JdapiIterator
JdapiException
public void remove() throws JdapiException
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
JdapiException