Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.basex.query.iter
Class Iter

    java.lang.Object
      org.basex.query.iter.Iter

All Implemented Interfaces:
  java.lang.Iterable<Item>

Direct Known Subclasses:
  FTNodeIter, NodeIter, RangeIter, SeqIter

    public abstract class Iter

extends java.lang.Object
implements java.lang.Iterable<Item>

Iterator interface.

Author:
  Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Field Summary
`static Iter` | `EMPTY` Empty iterator.

Constructor Summary
`Iter()`

Method Summary
`Item` | `finish()` Returns a sequence from all iterator values.
`Item` | `get(long i)` Returns the specified item.
`java.util.Iterator<Item>` | `iterator()`
`abstract Item` | `next()` Returns the next item or null if no other items are found.
`boolean` | `reset()` Resets the iterator and returns true.
`boolean` | `reverse()` Reverses the iterator and returns true.
`int` | `size()` Returns the number of entries.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EMPTY

    public static final Iter EMPTY

  Empty iterator.

Constructor Detail

### Iter

    public Iter()

Method Detail

### next

    public abstract Item next()
                       throws QueryException

  Returns the next item or null if no other items are found.

  Returns:
    resulting item
  Throws:
    `QueryException` - evaluation exception

### get

    public Item get(long i)

  Returns the specified item. Note: null is returned if the item cannot be retrieved, so the returned value has to be checked.

  Parameters:
    `i` - value offset
  Returns:
    specified item

### size

    public int size()

  Returns the number of entries. Note: -1 is returned if the number cannot be retrieved, so the returned value has to be checked. If this method is implemented, `get(long)` has to be implemented as well.

  Returns:
    number of entries

### reset

    public boolean reset()

  Resets the iterator and returns true. Note: false is returned if the iterator cannot be reset, so the returned value has to be checked.

  Returns:
    true if operator could be reset

### reverse

    public boolean reverse()

  Reverses the iterator and returns true. Note: false is returned if the iterator cannot be reset, so the returned value has to be checked.

  Returns:
    true if operator could be reversed

### finish

    public Item finish()
                throws QueryException

  Returns a sequence from all iterator values. Should be called before `next()`.

  Returns:
    sequence
  Throws:
    `QueryException` - evaluation exception

### iterator

    public java.util.Iterator<Item> iterator()

  Specified by:
    `iterator` in interface `java.lang.Iterable<Item>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD