Class NameTest


public final class NameTest extends Test
Name test.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

    • qname

      public final QNm qname
      QName test.
    • part

      public final NamePart part
      Part of name to be tested.
    • local

      public final byte[] local
      Local name.
  • Constructor Details

    • NameTest

      public NameTest(QNm name)
      Convenience constructor for element tests.
      Parameters:
      name - node name
    • NameTest

      public NameTest(QNm qname, NamePart part, NodeType type, byte[] defaultNs)
      Constructor.
      Parameters:
      qname - name
      part - part of name to be tested
      type - node type
      defaultNs - default element namespace (used for optimizations, can be null)
  • Method Details

    • noMatches

      public boolean noMatches(Data data)
      Description copied from class: Test
      Checks if evaluation can be dropped.
      Overrides:
      noMatches in class Test
      Parameters:
      data - data reference (can be null)
      Returns:
      result of check
    • copy

      public Test 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(QNm qName)
      Checks if the specified name matches the test.
      Parameters:
      qName - name
      Returns:
      result of check
    • part

      public NamePart part()
      Returns the name part relevant at runtime.
      Returns:
      name part
    • 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 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