Class IndexedValue

  • All Implemented Interfaces:
    GroundedValue, Sequence

    public class IndexedValue
    extends SearchableValue
    A representation of a (sequence) value that allows the construction of one or more indexes to provide rapid access to the items in the sequence.
    • Method Detail

      • findItems

        public SequenceIterator findItems​(Expression use,
                                          SequenceIterator values,
                                          boolean convertUntypedToOther,
                                          boolean firstOnly,
                                          AtomicComparer comparer,
                                          XPathContext context)
                                   throws XPathException
        Retrieve items that match a given index value
        Specified by:
        findItems in class SearchableValue
        Parameters:
        use - the expression whose value is to be matched
        values - the set of values to be found
        convertUntypedToOther - true if untypedAtomic values are to be converted to the type of the other operand
        firstOnly - true if only the first matching item is required
        comparer - AtomicComparer used to compare values for equality (encapsulates a collation if necessary)
        context - the dynamic evaluation context @return an iterator over the items that match the specified values
        Returns:
        an iterator over the items that matched
        Throws:
        XPathException - if an error occurs
      • containsNode

        public boolean containsNode​(NodeInfo sought)
        Determine whether the value contains a particular node. This implementation of the method builds a representation of the node-sequence as a Java HashSet the first time it is invoked, and subsequently does a fast lookup in this HashSet rather than performing a sequential search.
        Parameters:
        sought - the sought-after node
        Returns:
        true if the value contains this node