Class KindTest


  • public class KindTest
    extends Test
    Simple node kind test.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Field Detail

      • DOCUMENT_NODE

        public static final KindTest DOCUMENT_NODE
        Generic document node test.
      • ELEMENT

        public static final KindTest ELEMENT
        Generic element node test.
      • ATTRIBUTE

        public static final KindTest ATTRIBUTE
        Generic attribute node test.
      • PROCESSING_INSTRUCTION

        public static final KindTest PROCESSING_INSTRUCTION
        Generic PI node test.
      • NAMESPACE_NODE

        public static final KindTest NAMESPACE_NODE
        Generic namespace node test. No other NodeType.COMMENT tests exist.
    • Method Detail

      • get

        public static KindTest get​(NodeType type)
        Returns a test instance.
        Parameters:
        type - node type
        Returns:
        kind test
      • copy

        public final KindTest copy()
        Description copied from class: Test
        Copies this test.
        Specified by:
        copy in class Test
        Returns:
        deep copy
      • matches

        public boolean matches​(ANode node)
        Description copied from class: Test
        Checks if the specified node matches the test.
        Specified by:
        matches in class Test
        Parameters:
        node - node to be checked
        Returns:
        result of check
      • matches

        public Boolean matches​(SeqType seqType)
        Description copied from class: Test
        Checks if the current test will match items of the specified type.
        Overrides:
        matches in class Test
        Parameters:
        seqType - type to be checked
        Returns:
        result of check (matches never, always, or null if unknown)
      • instanceOf

        public boolean instanceOf​(Test test)
        Description copied from class: Test
        Checks if the current test is an instance of the specified test.
        Overrides:
        instanceOf in class Test
        Parameters:
        test - test to be checked
        Returns:
        result of check
      • intersect

        public Test intersect​(Test test)
        Description copied from class: Test
        Computes the intersection between two tests.
        Specified by:
        intersect in class Test
        Parameters:
        test - other test
        Returns:
        intersection if it exists, null otherwise
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public String toString​(boolean full)
        Description copied from class: Test
        Returns a string representation of this test.
        Specified by:
        toString in class Test
        Parameters:
        full - include node type
        Returns:
        string