org.basex.query.xpath.locpath
Class TestPI

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

public final class TestPI
extends Test

XPath Processing Instruction Test. Tests for a specific processing instruction.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Tim Petrowsky

Constructor Summary
TestPI(byte[] nm)
          Constructor with Literal.
 
Method Summary
 boolean eval(Data data, int pre, int kind)
          Evaluates a node test.
 boolean sameAs(Test test)
          Checks current and specified class for equivalence.
static boolean startsWith(byte[] tok, byte[] sub)
          Checks if the first token starts with the second token.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.query.xpath.locpath.Test
compile, eval
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestPI

public TestPI(byte[] nm)
Constructor with Literal.

Parameters:
nm - name of the processing instruction
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

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

startsWith

public static boolean startsWith(byte[] tok,
                                 byte[] sub)
Checks if the first token starts with the second token.

Parameters:
tok - first token
sub - second token
Returns:
result of test

toString

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