Class Iter

java.lang.Object
org.basex.query.iter.Iter
Direct Known Subclasses:
AtomIter, BasicIter, FTIter, NodeIter

public abstract class Iter extends Object
Iterator interface.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Iter

      public Iter()
  • Method Details

    • next

      public abstract Item next() throws QueryException
      Returns the next item.
      Returns:
      resulting item, or null if all items have been returned
      Throws:
      QueryException - query exception
    • get

      public Item get(long i) throws QueryException
      Returns the specified item, or an arbitrary item if the index is invalid. If this method returns items, size() needs to be implemented as well.
      Parameters:
      i - value offset (starting with 0)
      Returns:
      specified item or null
      Throws:
      QueryException - query exception
    • size

      public long size() throws QueryException
      Returns the iterator size. -1 is returned if the result size is unknown. If this method returns a positive value, get(long) needs to be implemented as well.
      Returns:
      number of entries
      Throws:
      QueryException - query exception
    • iterValue

      public Value iterValue()
      If available, returns a value on which the iterator is based on.
      Returns:
      value or null
    • value

      public Value value(QueryContext qc, Expr expr) throws QueryException
      Returns a value with all iterated items. This method should always be called before single items have been requested. Otherwise, it might not return all items.
      Parameters:
      qc - query context
      expr - original expression (can be null; if assigned, type of result sequence will be refined)
      Returns:
      value
      Throws:
      QueryException - query exception