org.basex.query.path
Class NameTest

java.lang.Object
  extended by org.basex.query.path.Test
      extended by org.basex.query.path.NameTest

public final class NameTest
extends Test

Name test.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.query.path.Test
Test.Mode
 
Field Summary
 byte[] ln
          Local name.
 
Fields inherited from class org.basex.query.path.Test
ATT, COM, DOC, ELM, mode, name, NOD, NSP, PI, TXT, type
 
Constructor Summary
NameTest(boolean att)
          Empty constructor ('*').
NameTest(QNm nm, Test.Mode t, boolean att)
          Constructor.
 
Method Summary
 boolean compile(QueryContext ctx)
          Optimizes and compiles the expression.
 Test copy()
          Copies this test.
 boolean eq(ANode node)
          Tests if the test yields true.
 boolean eq(QNm nm)
          Checks if the specified name matches the test.
 Test intersect(Test other)
          Computes the intersection between two tests.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.path.Test
eq, get, nsSensitive, sameAs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ln

public final byte[] ln
Local name.

Constructor Detail

NameTest

public NameTest(boolean att)
Empty constructor ('*').

Parameters:
att - attribute flag

NameTest

public NameTest(QNm nm,
                Test.Mode t,
                boolean att)
Constructor.

Parameters:
nm - name
t - type of name test
att - attribute flag
Method Detail

compile

public boolean compile(QueryContext ctx)
Description copied from class: Test
Optimizes and compiles the expression.

Overrides:
compile in class Test
Parameters:
ctx - query context
Returns:
false if test always returns false

copy

public Test copy()
Description copied from class: Test
Copies this test.

Specified by:
copy in class Test
Returns:
deep copy

eq

public boolean eq(ANode node)
Description copied from class: Test
Tests if the test yields true.

Specified by:
eq in class Test
Parameters:
node - node to be checked
Returns:
result of check

eq

public boolean eq(QNm nm)
Checks if the specified name matches the test.

Parameters:
nm - name
Returns:
result of check

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

intersect

public Test intersect(Test other)
Description copied from class: Test
Computes the intersection between two tests.

Specified by:
intersect in class Test
Parameters:
other - other test
Returns:
intersection if it exists, null otherwise