Class TreeSeq

All Implemented Interfaces:
Iterable<Item>
Direct Known Subclasses:
BigSeq, SmallSeq

public abstract class TreeSeq extends Seq
A tree storing Items.
Author:
BaseX Team 2005-21, BSD License, Leo Woerteler
  • Method Details

    • copyInsert

      protected final Value copyInsert(long pos, Value value, QueryContext qc)
      Description copied from class: Seq
      Helper for Seq.insertBefore(long, Value, QueryContext) that copies all items into a TreeSeq.
      Overrides:
      copyInsert in class Seq
      Parameters:
      pos - position at which the value should be inserted, must be between 0 and Seq.size
      value - value to insert
      qc - query context
      Returns:
      resulting value
    • concat

      public abstract TreeSeq concat(TreeSeq other)
      Concatenates this sequence with another one. Running time: O(log (min { this.size(), other.size() }))
      Parameters:
      other - array to append to the end of this array
      Returns:
      resulting array
    • iterator

      public abstract ListIterator<Item> iterator(long start)
      Iterator over the members of this sequence.
      Parameters:
      start - starting position (i.e. the position initially returned by ListIterator.nextIndex())
      Returns:
      array over the array members
    • iterator

      public final Iterator<Item> iterator()
      Specified by:
      iterator in interface Iterable<Item>
      Overrides:
      iterator in class Value
    • iter

      public abstract BasicIter<Item> iter()
      Description copied from class: Value
      Returns an iterator.
      Overrides:
      iter in class Seq
      Returns:
      iterator
    • cache

      public final void cache(boolean lazy, InputInfo ii) throws QueryException
      Description copied from class: Value
      Caches lazy values.
      Specified by:
      cache in class Value
      Parameters:
      lazy - lazy caching
      ii - input info
      Throws:
      QueryException - query exception
    • atomValue

      public final Value atomValue(QueryContext qc, InputInfo ii) throws QueryException
      Description copied from class: Expr
      Evaluates the expression and returns the atomized items.
      Specified by:
      atomValue in class Expr
      Parameters:
      qc - query context
      ii - input info (only required by Seq instances, which have no input info)
      Returns:
      atomized item
      Throws:
      QueryException - query exception
    • atomSize

      public final long atomSize()
      Description copied from class: Value
      Computes the number of atomized items.
      Specified by:
      atomSize in class Value
      Returns:
      atomized item
    • ebv

      public final Item ebv(QueryContext qc, InputInfo ii) throws QueryException
      Description copied from class: Expr

      Checks if the effective boolean value can be computed for this expression:

      • If it yields an empty sequence, Bln.FALSE will be returned.
      • If it yields a single item, this item will be returned.
      • If it yields nodes, the first node will be returned.
      • Otherwise, an error will be raised.

      A single numeric item may later be evaluated as positional predicate.

      Specified by:
      ebv in class Expr
      Parameters:
      qc - query context
      ii - input info (required for Seq instances, which have no input info)
      Returns:
      item
      Throws:
      QueryException - query exception