net.sf.joost.grammar.tree
Class PiTestTree

java.lang.Object
  extended by net.sf.joost.grammar.Tree
      extended by net.sf.joost.grammar.tree.PiTestTree
All Implemented Interfaces:
Cloneable

public final class PiTestTree
extends Tree

Objects of PiTree represent processing-instruction node test nodes in the syntax tree of a pattern or an STXPath expression.

Version:
$Revision: 1.2 $ $Date: 2007/05/20 18:00:44 $
Author:
Oliver Becker

Field Summary
private  String piKeyName
          key in the position map
 
Fields inherited from class net.sf.joost.grammar.Tree
ADD, AND, ATTR, ATTR_LOCAL_WILDCARD, ATTR_URI_WILDCARD, ATTR_WILDCARD, AVT, CDATA_TEST, CHILD, COMMENT_TEST, DDOT, DESC, DIV, DOT, EQ, FUNCTION, GE, GT, LE, left, LIST, lName, LOCAL_WILDCARD, LT, MOD, MULT, NAME_TEST, NE, NODE_TEST, NUMBER, OR, PI_TEST, PREDICATE, right, ROOT, SEQ, STRING, SUB, TEXT_TEST, type, UNION, uri, URI_WILDCARD, value, VALUE, VAR, WILDCARD
 
Constructor Summary
PiTestTree()
          Constructs a PiTextTree that represents a processing-instruction test without a string literal.
PiTestTree(Object literal)
          Constructs a PiTextTree that represents a processing-instruction test that contains a string literal.
 
Method Summary
 double getPriority()
          Returns the default priority of the STXPath pattern represented by this tree.
 boolean isConstant()
           
 boolean matches(Context context, int top, boolean setPosition)
          Determines if the event stack matches the pattern represented by this Tree object.
 
Methods inherited from class net.sf.joost.grammar.Tree
deepCopy, evaluate, evaluate, reverseAssociativity, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

piKeyName

private String piKeyName
key in the position map

Constructor Detail

PiTestTree

public PiTestTree()
Constructs a PiTextTree that represents a processing-instruction test without a string literal.


PiTestTree

public PiTestTree(Object literal)
Constructs a PiTextTree that represents a processing-instruction test that contains a string literal.

Parameters:
literal - the string literal
Method Detail

matches

public boolean matches(Context context,
                       int top,
                       boolean setPosition)
                throws SAXException
Description copied from class: Tree
Determines if the event stack matches the pattern represented by this Tree object.

Overrides:
matches in class Tree
Parameters:
context - the Context object
top - the part of the stack to be considered while matching (the upper most element is at position top-1)
setPosition - true if the context position (Context.position) should be set in case the event stack matches this pattern
Returns:
true if the stack matches the pattern represented by this Tree.
Throws:
SAXException

getPriority

public double getPriority()
Description copied from class: Tree
Returns the default priority of the STXPath pattern represented by this tree.

Overrides:
getPriority in class Tree

isConstant

public boolean isConstant()
Overrides:
isConstant in class Tree
Returns:
whether the expression represented by this tree is constant