Class ItemSeq

All Implemented Interfaces:
Iterable<Item>

public final class ItemSeq extends Seq
Flat item sequence.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • ebv

      public 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
    • itemAt

      public Item itemAt(long pos)
      Description copied from class: Value
      Returns the item at the given position in the value. The specified value must be lie within the valid bounds.
      Specified by:
      itemAt in class Value
      Parameters:
      pos - position
      Returns:
      item
    • atomValue

      public 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
    • reverse

      public Value reverse(QueryContext qc)
      Description copied from class: Value
      Returns all items of this value in reverse order.
      Specified by:
      reverse in class Value
      Parameters:
      qc - query context
      Returns:
      items in reverse order
    • equals

      public boolean equals(Object obj)
      Description copied from class: Expr
      This function is e.g. called by:
      Overrides:
      equals in class Seq
    • insert

      public Value insert(long pos, Item item, QueryContext qc)
      Description copied from class: Seq
      Inserts an item at the given position into this sequence and returns the resulting sequence.
      Specified by:
      insert in class Seq
      Parameters:
      pos - position at which the item should be inserted, must be between 0 and Seq.size
      item - item to insert
      qc - query context
      Returns:
      resulting value
    • remove

      public Value remove(long pos, QueryContext qc)
      Description copied from class: Seq
      Removes the item at the given position in this sequence and returns the resulting sequence.
      Specified by:
      remove in class Seq
      Parameters:
      pos - position of the item to remove, must be between 0 and Seq.size - 1
      qc - query context
      Returns:
      resulting sequence
    • cache

      public 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
    • atomSize

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

      public static Value get(Item[] values, int size, Type type)
      Creates a typed sequence with the items of the specified values.
      Parameters:
      size - size of resulting sequence
      values - values
      type - type (can be null, only considered if new sequence is created)
      Returns:
      value
    • get

      public static Value get(Item[] values, int size, Expr expr)
      Creates a typed sequence with the items of the specified values.
      Parameters:
      size - size of resulting sequence
      values - values
      expr - expression (can be null, only considered if new sequence is created)
      Returns:
      value