org.basex.query.xquery.iter
Class SeqIter

java.lang.Object
  extended by org.basex.query.xquery.iter.Iter
      extended by org.basex.query.xquery.iter.SeqIter

public final class SeqIter
extends Iter

Sequence Iterator.

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

Field Summary
 Item[] item
          Items.
 int pos
          Iterator.
 int size
          Size.
 
Fields inherited from class org.basex.query.xquery.iter.Iter
EMPTY
 
Constructor Summary
SeqIter()
          Constructor.
SeqIter(Iter iter)
          Constructor.
 
Method Summary
 void add(Item it)
          Adds a single item.
 void add(Iter iter)
          Adds the contents of an iterator.
static Iter get(Item[] it, int s)
          Constructor.
 Item next()
          Returns the next item or null if no other items are found.
 void reset()
          Resets the iterator; can be optionally implemented.
 long size()
          Returns the number of entries.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xquery.iter.Iter
atomic, ebv, finish, seqErr
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

item

public Item[] item
Items.


size

public int size
Size.


pos

public int pos
Iterator.

Constructor Detail

SeqIter

public SeqIter()
Constructor.


SeqIter

public SeqIter(Iter iter)
        throws XQException
Constructor.

Parameters:
iter - iterator
Throws:
XQException - evaluation exception
Method Detail

get

public static Iter get(Item[] it,
                       int s)
Constructor.

Parameters:
it - item array
s - size
Returns:
iterator

add

public void add(Iter iter)
         throws XQException
Adds the contents of an iterator.

Parameters:
iter - entry to be added
Throws:
XQException - evaluation exception

add

public void add(Item it)
Adds a single item.

Parameters:
it - item to be added

next

public Item next()
Description copied from class: Iter
Returns the next item or null if no other items are found.

Specified by:
next in class Iter
Returns:
resulting item

reset

public void reset()
Description copied from class: Iter
Resets the iterator; can be optionally implemented.

Overrides:
reset in class Iter

size

public long size()
Description copied from class: Iter
Returns the number of entries. Warning: -1 is returned if the number cannot be evaluated, so each method has to check and react on the returned value.

Overrides:
size in class Iter
Returns:
number of entries

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object