Class BlnSeq

All Implemented Interfaces:
Iterable<Item>

public final class BlnSeq extends Seq
Sequence of items of type xs:boolean, containing at least two of them.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • itemAt

      public Bln 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
    • 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
    • toJava

      public boolean[] toJava()
      Description copied from class: Value
      Returns a Java representation of the value.
      Overrides:
      toJava in class Seq
      Returns:
      Java object
    • equals

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

      public static Value get(boolean[] values)
      Creates a sequence with the specified items.
      Parameters:
      values - values
      Returns:
      value
    • 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
    • cache

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

      public Value atomValue(QueryContext qc, InputInfo ii)
      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
    • 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
    • insert

      public final Value insert(long pos, Item item, QueryContext qc)
      Inserts an item at the given position into this sequence and returns the resulting sequence. Because this function will mostly be invoked recursively, the standard implementation will be called, because its runtime outweighs the possibly higher memory consumption.
      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 final Value remove(long pos, QueryContext qc)
      Removes the item at the given position in this sequence and returns the resulting sequence. Because this function will mostly be invoked recursively, the standard implementation will be called, because its runtime outweighs the possibly higher memory consumption.
      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