|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.grammar.Tree
public abstract class Tree
Objects of Tree represent nodes in the syntax tree of a pattern or an STXPath expression.
Field Summary | |
---|---|
static int |
ADD
Node type constants for type |
static int |
AND
Node type constants for type |
static int |
ATTR
Node type constants for type |
static int |
ATTR_LOCAL_WILDCARD
Node type constants for type |
static int |
ATTR_URI_WILDCARD
Node type constants for type |
static int |
ATTR_WILDCARD
Node type constants for type |
static int |
AVT
Node type constants for type |
static int |
CDATA_TEST
Node type constants for type |
static int |
CHILD
Node type constants for type |
static int |
COMMENT_TEST
Node type constants for type |
static int |
DDOT
Node type constants for type |
static int |
DESC
Node type constants for type |
static int |
DIV
Node type constants for type |
static int |
DOT
Node type constants for type |
static int |
EQ
Node type constants for type |
static int |
FUNCTION
Node type constants for type |
static int |
GE
Node type constants for type |
static int |
GT
Node type constants for type |
static int |
LE
Node type constants for type |
Tree |
left
The left subtree. |
static int |
LIST
Node type constants for type |
String |
lName
Local name if value is a qualified name. |
static int |
LOCAL_WILDCARD
Node type constants for type |
static int |
LT
Node type constants for type |
static int |
MOD
Node type constants for type |
static int |
MULT
Node type constants for type |
static int |
NAME_TEST
Node type constants for type |
static int |
NE
Node type constants for type |
static int |
NODE_TEST
Node type constants for type |
static int |
NUMBER
Node type constants for type |
static int |
OR
Node type constants for type |
static int |
PI_TEST
Node type constants for type |
static int |
PREDICATE
Node type constants for type |
Tree |
right
The right subtree. |
static int |
ROOT
Node type constants for type |
static int |
SEQ
Node type constants for type |
static int |
STRING
Node type constants for type |
static int |
SUB
Node type constants for type |
static int |
TEXT_TEST
Node type constants for type |
int |
type
The type of the node in the Tree. |
static int |
UNION
Node type constants for type |
String |
uri
URI if value is a qualified name. |
static int |
URI_WILDCARD
Node type constants for type |
Object |
value
The value of this node as an object. |
static int |
VALUE
Node type constants for type |
static int |
VAR
Node type constants for type |
static int |
WILDCARD
Node type constants for type |
Constructor Summary | |
---|---|
|
Tree(int type)
Constructs a Tree object as a leaf without a value. |
|
Tree(int type,
Object value)
Constructs a Tree object as a leaf. |
|
Tree(int type,
Tree left,
Tree right)
Constructs a Tree object as a node with two subtrees. |
private |
Tree(int type,
Tree left,
Tree right,
Object value)
The most general constructor |
Method Summary | |
---|---|
Tree |
deepCopy(HashMap copies)
Creates a deep copy of this Tree |
Value |
evaluate(Context context,
int top)
Evaluates the current Tree if it represents an expression. |
Value |
evaluate(Context context,
NodeBase instruction)
Evaluates the current Tree if it represents an expression. |
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. |
Tree |
reverseAssociativity()
May be overridden to reconstruct the current tree |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ROOT
type
public static final int CHILD
type
public static final int DESC
type
public static final int UNION
type
public static final int NAME_TEST
type
public static final int WILDCARD
type
public static final int URI_WILDCARD
type
public static final int LOCAL_WILDCARD
type
public static final int NODE_TEST
type
public static final int TEXT_TEST
type
public static final int CDATA_TEST
type
public static final int COMMENT_TEST
type
public static final int PI_TEST
type
public static final int FUNCTION
type
public static final int PREDICATE
type
public static final int NUMBER
type
public static final int STRING
type
public static final int ADD
type
public static final int SUB
type
public static final int MULT
type
public static final int DIV
type
public static final int MOD
type
public static final int AND
type
public static final int OR
type
public static final int EQ
type
public static final int NE
type
public static final int LT
type
public static final int LE
type
public static final int GT
type
public static final int GE
type
public static final int ATTR
type
public static final int ATTR_WILDCARD
type
public static final int ATTR_URI_WILDCARD
type
public static final int ATTR_LOCAL_WILDCARD
type
public static final int LIST
type
public static final int SEQ
type
public static final int AVT
type
public static final int VAR
type
public static final int DOT
type
public static final int DDOT
type
public static final int VALUE
type
public int type
public Tree left
public Tree right
public Object value
public String uri
value
is a qualified name.
public String lName
value
is a qualified name.
Constructor Detail |
---|
private Tree(int type, Tree left, Tree right, Object value)
public Tree(int type, Tree left, Tree right)
public Tree(int type, Object value)
public Tree(int type)
Method Detail |
---|
public boolean matches(Context context, int top, boolean setPosition) throws SAXException
context
- the Context objecttop
- 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
true
if the stack matches the pattern represented
by this Tree.
SAXException
public Value evaluate(Context context, NodeBase instruction) throws SAXException
context
- the current Contextinstruction
- the current instruction, needed for providing
locator information in the event of an error
SAXException
public Value evaluate(Context context, int top) throws SAXException
context
- the current Contexttop
- the part of the stack to be considered for the evaluation
(the upper most element is at position top-1)
SAXException
public Tree reverseAssociativity()
public double getPriority()
public boolean isConstant()
public Tree deepCopy(HashMap copies)
copies
- the map of already copied objects that need to be remembered
(mainly of AbstractInstruction
)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |