|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.iter.Iter
org.basex.query.iter.ValueIter
public abstract class ValueIter
Value iterator interface, throwing no exceptions.
This class also implements the Iterable
interface, which is why all of its
values can also be retrieved via enhanced for (for-each) loops. Note, however, that
using the next()
method will give you better performance.
Constructor Summary | |
---|---|
ValueIter()
|
Method Summary | |
---|---|
abstract Item |
get(long i)
Returns the specified item, or an arbitrary item if the index is invalid. |
java.util.Iterator<Item> |
iterator()
|
abstract Item |
next()
Returns the next item or null if no other items are found. |
abstract boolean |
reset()
Resets the iterator and returns true if operation was successful. |
abstract long |
size()
Returns the iterator size. |
Value |
value()
Returns a sequence with all iterator values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueIter()
Method Detail |
---|
public abstract Item next()
Iter
null
if no other items are found.
next
in class Iter
null
public abstract Item get(long i)
Iter
Iter.size()
returns the correct number of results. A calling method
should call Iter.reset()
after the last items has been retrieved.
get
in class Iter
i
- value offset
public abstract long size()
Iter
-1
is returned if the
result size is unknown. If this method is implemented by an iterator,
Iter.get(long)
needs to be implemented as well.
size
in class Iter
public abstract boolean reset()
Iter
true
if operation was successful.
false
is returned if the iterator cannot be reset.
reset
in class Iter
public Value value()
Iter
Iter.next()
has not been called before.
value
in class Iter
public final java.util.Iterator<Item> iterator()
iterator
in interface java.lang.Iterable<Item>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |