Class Dummy

  • All Implemented Interfaces:
    Iterable<Item>

    public final class Dummy
    extends Value
    Dummy item (only used at compile time).
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Constructor Detail

      • Dummy

        public Dummy​(Expr expr,
                     boolean item)
        Constructor.
        Parameters:
        expr - input expression
        item - focus single item
    • Method Detail

      • seqType

        public SeqType seqType()
        Description copied from class: Expr
        Returns the static type of the resulting value.
        Specified by:
        seqType in class Expr
        Returns:
        result of check
      • size

        public long size()
        Description copied from class: Expr
        Returns the result size, or -1 if the size is unknown.
        Specified by:
        size in class Expr
        Returns:
        result of check
      • data

        public Data data()
        Description copied from class: Expr
        Returns the data reference bound to this expression. This method is currently overwritten by DBNode, DBNodeSeq, AxisPath and VarRef.
        Overrides:
        data in class Expr
        Returns:
        data reference (can be null)
      • toJava

        public String toJava()
        Description copied from class: Value
        Returns a Java representation of the value.
        Specified by:
        toJava in class Value
        Returns:
        Java object
      • toXml

        public void toXml​(QueryPlan plan)
        Description copied from class: ExprInfo
        Creates a query plan.
        Specified by:
        toXml in class ExprInfo
        Parameters:
        plan - expression plan
      • iter

        public BasicIter<Item> iter()
        Description copied from class: Value
        Returns an iterator.
        Specified by:
        iter in class Value
        Returns:
        iterator
      • materialize

        public Value materialize​(Predicate<Data> test,
                                 InputInfo ii,
                                 QueryContext qc)
                          throws QueryException
        Description copied from class: Value
        Returns a materialized version of this value without dependencies to persistent data. Raises an error if the value contains function items.
        Specified by:
        materialize in class Value
        Parameters:
        test - test to check if a node can be adopted unchanged
        ii - input info (can be null)
        qc - query context
        Returns:
        materialized value
        Throws:
        QueryException - query exception
      • materialized

        public boolean materialized​(Predicate<Data> test,
                                    InputInfo ii)
                             throws QueryException
        Description copied from class: Value
        Checks if this value is materialized, i.e., contains no persistent database nodes or function items.
        Specified by:
        materialized in class Value
        Parameters:
        test - test to check if a node can be adopted unchanged
        ii - input info (can be null)
        Returns:
        result of check
        Throws:
        QueryException - query exception
      • subsequence

        public Value subsequence​(long start,
                                 long length,
                                 QueryContext qc)
        Description copied from class: Value
        Returns a subsequence of this value with the given start and length. The following properties must hold:
        • start >= 0,
        • length >= 0,
        • length <= size() - start
        Specified by:
        subsequence in class Value
        Parameters:
        start - starting position
        length - number of items
        qc - query context
        Returns:
        sub sequence
      • cache

        public void cache​(boolean lazy,
                          InputInfo ii)
                   throws QueryException
        Description copied from class: Value
        Caches data of lazy items (i.e., those implementing the Lazy interface). By calling this method, the streaming feature of lazy items will be disabled.
        Specified by:
        cache in class Value
        Parameters:
        lazy - if false, cache immediately. if true, caching is deferred until the data is actually requested
        ii - input info (can be null)
        Throws:
        QueryException - query exception
      • sameType

        public boolean sameType()
        Description copied from class: Value
        Checks if all items of the sequence are of the same type.
        Specified by:
        sameType in class Value
        Returns:
        result of check
      • 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
      • 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
      • 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 (can be null); required for those Value instances that have no input info)
        Returns:
        atomized item
        Throws:
        QueryException - query exception
      • test

        public boolean test​(QueryContext qc,
                            InputInfo ii,
                            long pos)
                     throws QueryException
        Description copied from class: Expr
        Computes the effective boolean value for this expression.
        Specified by:
        test in class Expr
        Parameters:
        qc - query context
        ii - input info (can be null); required for those Value instances that have no input info)
        pos - position of context item (if 0, perform EBV test)
        Returns:
        item
        Throws:
        QueryException - query exception
      • refineType

        public void refineType​(Expr ex)
        Description copied from class: Expr
        Refines the expression type.
        Specified by:
        refineType in class Expr
        Parameters:
        ex - original expression
      • toString

        public void toString​(QueryString qs)
        Description copied from class: ExprInfo
        Creates a query string.
        Specified by:
        toString in class ExprInfo
        Parameters:
        qs - query string builder