org.basex.query.iter
Class NodIter

java.lang.Object
  extended by org.basex.query.iter.Iter
      extended by org.basex.query.iter.NodeIter
          extended by org.basex.query.iter.NodIter
All Implemented Interfaces:
java.lang.Iterable<Item>

public final class NodIter
extends NodeIter

Simple node Iterator, ignoring duplicates.

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

Field Summary
 Nod[] list
          Items.
 int size
          Size.
 
Fields inherited from class org.basex.query.iter.NodeIter
NONE
 
Fields inherited from class org.basex.query.iter.Iter
EMPTY
 
Constructor Summary
NodIter()
          Constructor.
NodIter(boolean d)
          Constructor.
 
Method Summary
 void add(Nod n)
          Adds a node.
 void delete(int p)
          Deletes a value at the specified position.
 Item finish()
          Returns a sequence from all iterator values.
 Item get(long i)
          Returns the specified item.
 Nod next()
          Returns the next item or null if no other items are found.
 boolean reset()
          Resets the iterator and returns true.
 int size()
          Returns the number of entries.
 void sort(boolean force)
          Sorts the nodes.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.iter.Iter
iterator, reverse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

public Nod[] list
Items.


size

public int size
Size.

Constructor Detail

NodIter

public NodIter()
Constructor.


NodIter

public NodIter(boolean d)
Constructor.

Parameters:
d - returns if the iterator might return duplicates
Method Detail

delete

public void delete(int p)
Deletes a value at the specified position.

Parameters:
p - deletion position

add

public void add(Nod n)
Adds a node.

Parameters:
n - node to be added

reset

public boolean reset()
Description copied from class: Iter
Resets the iterator and returns true. Note: false is returned if the iterator cannot be reset, so the returned value has to be checked.

Overrides:
reset in class Iter
Returns:
true if operator could be reset

next

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

Specified by:
next in class NodeIter
Returns:
resulting item

get

public Item get(long i)
Description copied from class: Iter
Returns the specified item. Note: null is returned if the item cannot be retrieved, so the returned value has to be checked.

Overrides:
get in class Iter
Parameters:
i - value offset
Returns:
specified item

size

public int size()
Description copied from class: Iter
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, Iter.get(long) has to be implemented as well.

Overrides:
size in class Iter
Returns:
number of entries

finish

public Item finish()
Description copied from class: Iter
Returns a sequence from all iterator values. Should be called before Iter.next().

Overrides:
finish in class Iter
Returns:
sequence

sort

public void sort(boolean force)
Sorts the nodes.

Parameters:
force - force sort

toString

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