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 overJdapiExceptionpublic void goLast()
goLast in interface JdapiIteratorpublic void goStart()
goStart in interface JdapiIteratorpublic boolean hasNext()
hasNext in interface java.util.IteratorhasNext in interface JdapiIteratorpublic boolean hasPrevious()
hasPrevious in interface JdapiIteratorpublic java.lang.Object next()
throws JdapiException
next in interface java.util.Iteratornext in interface JdapiIteratorJdapiExceptionpublic java.lang.Object previous()
throws JdapiException
previous in interface JdapiIteratorJdapiExceptionpublic 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.Iteratorremove in interface JdapiIteratorJdapiException