Class UniversalPattern

    • Constructor Detail

      • UniversalPattern

        public UniversalPattern()
        Create an UniversalPattern that matches all items
    • Method Detail

      • matches

        public boolean matches​(Item item,
                               XPathContext context)
        Determine whether this Pattern matches the given Node. This is the main external interface for matching patterns: it sets current() to the node being tested
        Specified by:
        matches in class Pattern
        item - The item to be tested against the Pattern
        context - The context in which the match is to take place.
        true if the item matches the Pattern, false otherwise
      • getUType

        public UType getUType()
        Get a UType indicating which kinds of items this Pattern can match.
        Specified by:
        getUType in class Pattern
        a UType indicating all the primitive types of item that the pattern can match.
      • getItemType

        public ItemType getItemType()
        Get a NodeTest that all the nodes matching this pattern must satisfy
        Specified by:
        getItemType in class Pattern
        an ItemType, as specific as possible, which all the matching items satisfy
      • getFingerprint

        public int getFingerprint()
        Determine the name fingerprint of nodes to which this pattern applies. Used for optimisation.
        getFingerprint in class Pattern
        A fingerprint that the nodes must match, or -1 if it can match multiple fingerprints
      • reconstruct

        public java.lang.String reconstruct()
        Display the pattern for diagnostics
        reconstruct in class Pattern
      • export

        public void export​(ExpressionPresenter presenter)
        Description copied from class: Expression
        Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
        Specified by:
        export in interface ExportAgent
        Specified by:
        export in class Pattern
        presenter - the expression presenter used to display the structure
      • equals

        public boolean equals​(java.lang.Object other)
        Determine whether this pattern is the same as another pattern
        equals in class Expression
        other - the other object
        true if the other operand is an expression and if it can be determined that the two expressions are equivalent, in the sense that they will always return the same result.
      • computeHashCode

        public int computeHashCode()
        Hashcode supporting equals()
        computeHashCode in class Expression
        a computed hash code
      • copy

        public Pattern copy​(RebindingMap rebindings)
        Copy a UniversalPattern. Since there is only one, return the same.
        Specified by:
        copy in class Pattern
        rebindings - variables that need to be re-bound
        the original nodeTest