org.basex.query.path
Class Test

java.lang.Object
  extended by org.basex.query.path.Test
Direct Known Subclasses:
KindTest, NameTest

public abstract class Test
extends Object

XQuery node tests.

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

Nested Class Summary
static class Test.Kind
          Test types.
 
Field Summary
 Test.Kind kind
          Test type.
 QNm name
          Name test.
static Test NODE
          Static node test.
 Type type
          Node test.
 
Constructor Summary
Test()
           
 
Method Summary
 boolean comp(QueryContext ctx)
          Optimizes and compiles the expression.
abstract  boolean eval(Nod nod)
          Tests the specified node.
 boolean sameAs(Test t)
          Checks the current and specified test for equality.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE

public static final Test NODE
Static node test.


kind

public Test.Kind kind
Test type.


type

public Type type
Node test.


name

public QNm name
Name test.

Constructor Detail

Test

public Test()
Method Detail

comp

public boolean comp(QueryContext ctx)
             throws QueryException
Optimizes and compiles the expression.

Parameters:
ctx - query context
Returns:
false if test always returns false
Throws:
QueryException - query exception

eval

public abstract boolean eval(Nod nod)
                      throws QueryException
Tests the specified node.

Parameters:
nod - temporary node
Returns:
result of check
Throws:
QueryException - query exception

sameAs

public final boolean sameAs(Test t)
Checks the current and specified test for equality.

Parameters:
t - test to be compared
Returns:
result of check