class JdapiObjectListIterator extends java.lang.Object implements JdapiIterator
This class supports the JDK1.2 Iterator interface . It also supports the bidirectionality of the JDK1.2 ListIterator (but doesn't explicitly support that interface).
The typical way to use this (as JDK1.2 Iterator) is as follows:
while(items.hasNext()) { JdapiModule mod = (JdapiModule)modules.next(); // do something with module mod... }
Modifier | Constructor and Description |
---|---|
|
JdapiObjectListIterator(JdapiObject obj)
Constructor for creating an iterator to iterate through objects
from a given one.
|
|
JdapiObjectListIterator(JdapiObjectListIterator other)
Copy constructor.
|
protected |
JdapiObjectListIterator(long pd2fctx,
long pd2fob,
int property,
long d2ffox)
Constructor for creating an iterator based on a property of an
object.
|
protected |
JdapiObjectListIterator(long pd2fctx,
long pd2fob,
long d2ffox)
Constructor for creating an iterator at a given starting object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a copy of the iterator at the current position.
|
void |
goLast()
Moves the iterator to the end of the list.
|
void |
goStart()
Moves the iterator to the start of the list.
|
boolean |
hasMoreElements()
Returns true if the iteration has more elements.
|
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 |
nextElement()
Gets the next object.
|
java.lang.Object |
previous()
Gets the previous object (JDK1.2 list iterator style).
|
void |
remove()
Removes the current object from the iteration.
|
java.lang.String |
toString()
Get a string representation of the current state of the object.
|
public JdapiObjectListIterator(JdapiObject obj)
obj
- Object at which to start iterating from, note, the
JdapiObjectListIterator will return this as it's
first object.protected JdapiObjectListIterator(long pd2fctx, long pd2fob, int property, long d2ffox)
pd2fctx
- Forms API context pointerpd2fob
- Base object from which to get property to iterateproperty
- Property ID to get object to iterated2ffox
- Forms object type to createprotected JdapiObjectListIterator(long pd2fctx, long pd2fob, long d2ffox)
pd2fctx
- Forms API context pointerpd2fob
- Object at which to start iterating from, note, the
JdapiObjectListIterator will return this object as
it's first object.d2ffox
- Forms object type to createpublic JdapiObjectListIterator(JdapiObjectListIterator other)
other
- Iterator to copypublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public void goLast()
goLast
in interface JdapiIterator
public void goStart()
goStart
in interface JdapiIterator
public boolean hasMoreElements()
public boolean hasNext()
hasNext
in interface java.util.Iterator
hasNext
in interface JdapiIterator
public boolean hasPrevious()
hasPrevious
in interface JdapiIterator
public java.lang.Object nextElement()
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