org.basex.query.xpath.locpath
Class TestName

java.lang.Object
  extended by org.basex.query.xpath.locpath.Test
      extended by org.basex.query.xpath.locpath.TestName

public final class TestName
extends Test

NodeTest testing for a name match.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Field Summary
static int ALL
          Test accepting all names.
static byte[] ALLNODES
          Test accepting all names.
 int id
          Index reference to the Tag/Attribute.
 byte[] name
          Tag/Attribute name.
static int UNKNOWN
          Unknown tag/attribute name.
 
Constructor Summary
TestName(boolean t)
          Constructor, accepting all tags/attribute names.
TestName(byte[] nm, boolean t)
          Constructor.
 
Method Summary
 void compile(Data data)
          Optimizes the expression.
 boolean eval(Data data, int pre, int kind)
          Evaluates a node test.
 boolean sameAs(Test test)
          Checks current and specified class for equivalence.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.locpath.Test
eval
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALLNODES

public static final byte[] ALLNODES
Test accepting all names.


ALL

public static final int ALL
Test accepting all names.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown tag/attribute name.

See Also:
Constant Field Values

id

public int id
Index reference to the Tag/Attribute.


name

public final byte[] name
Tag/Attribute name.

Constructor Detail

TestName

public TestName(boolean t)
Constructor, accepting all tags/attribute names.

Parameters:
t - tag reference

TestName

public TestName(byte[] nm,
                boolean t)
Constructor.

Parameters:
nm - the name to match.
t - tag reference
Method Detail

eval

public boolean eval(Data data,
                    int pre,
                    int kind)
Description copied from class: Test
Evaluates a node test.

Specified by:
eval in class Test
Parameters:
data - data reference
pre - pre value
kind - node kind
Returns:
result of evaluation

compile

public void compile(Data data)
Description copied from class: Test
Optimizes the expression.

Overrides:
compile in class Test
Parameters:
data - data reference

sameAs

public boolean sameAs(Test test)
Description copied from class: Test
Checks current and specified class for equivalence.

Specified by:
sameAs in class Test
Parameters:
test - node test to be compared
Returns:
result of check

toString

public java.lang.String toString()
Specified by:
toString in class Test