Class AbstractRslNode
java.lang.Object
org.globus.rsl.AbstractRslNode
- Direct Known Subclasses:
ListRslNode, RslNode
This class represents an abstract RSL parse tree. It is composed of variable definitions
(bindings), relations, and sub-specifications (sub nodes).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(AbstractRslNode node) Adds a rsl parse tree to this node.abstract booleanabstract booleanadd(NameOpValue relations) static Stringcanonicalize(String str) Canonicalizes a string by removing any underscores and moving all characters to lowercase.evaluate()Evalutes the rsl tree.abstract AbstractRslNodeEvalutes the rsl tree against the specified symbol table.abstract BindingsgetBindings(String attribute) Returns the variable definitions associated wit the given attribute.intReturns the node operator.Returns the operator as a string.static StringgetOperatorAsString(int op) Returns a string represention of a given operator.abstract NameOpValueReturns the relation associated with the given attribute.Returns the list of sub-specifications.voidmerge(AbstractRslNode inNode) Merges the specified node with the current node.voidmergeTo(AbstractRslNode dstNode) abstract BindingsremoveBindings(String attribute) Removes a bindings list for the specified attribute.abstract NameOpValueremoveParam(String attribute) Removes a relation for the specified attribute.booleanRemoves a specific sub-specification tree from the sub-specification list.voidsetOperator(int oper) Sets the operator.toRSL(boolean explicitConcat) Returns a RSL representation of this relation.abstract voidtoRSL(StringBuffer buf, boolean explicitConcat) Produces a RSL representation of node.toString()
-
Field Details
-
AND
public static final int AND- See Also:
-
OR
public static final int OR- See Also:
-
MULTI
public static final int MULTI- See Also:
-
_operator
protected int _operator -
_specifications
-
-
Constructor Details
-
AbstractRslNode
public AbstractRslNode() -
AbstractRslNode
public AbstractRslNode(int operator)
-
-
Method Details
-
add
-
add
-
add
Adds a rsl parse tree to this node.- Parameters:
node- the rsl parse tree to add.
-
getParam
Returns the relation associated with the given attribute.- Parameters:
attribute- the attribute of the relation.- Returns:
- the relation for the attribute. Null, if not found.
-
getBindings
-
removeSpecification
Removes a specific sub-specification tree from the sub-specification list.- Parameters:
node- node to remove.- Returns:
- true if the tree was removed successfuly. False, otherwise.
-
removeBindings
-
removeParam
Removes a relation for the specified attribute.- Parameters:
attribute- the attribute name for the relation to remove.- Returns:
- the relation that was removed.
-
merge
Merges the specified node with the current node. All sub-specifications from the given node will be copied to the current node. All relations and variable definitions will be added together in the current node.- Parameters:
inNode- the source parse tree.
-
mergeTo
-
getSpecifications
Returns the list of sub-specifications.- Returns:
- the list of other sub-specifications.
-
getOperator
public int getOperator()Returns the node operator.- Returns:
- the operator.
-
setOperator
public void setOperator(int oper) Sets the operator.- Parameters:
oper- the operator.
-
getOperatorAsString
Returns the operator as a string.- Returns:
- operator in a string representation.
-
getOperatorAsString
Returns a string represention of a given operator.- Parameters:
op- the operator.- Returns:
- the string representation of the operator.
-
evaluate
Evalutes the rsl tree. All the variable definitions are first evaluated because they might update the symbol table. Then all the relations followed by the sub-specifications are evaluated.- Returns:
- the evaluated rsl tree.
- Throws:
RslEvaluationException- If an error occured during rsl evaluation.
-
evaluate
Evalutes the rsl tree against the specified symbol table. All the variable definitions are first evaluated because they might update the symbol table. Then all the relations followed by the sub-specifications are evaluated.- Parameters:
symbolTable- the symbol table to evalute variables against.- Returns:
- the evaluated rsl tree.
- Throws:
RslEvaluationException- If an error occured during rsl evaluation.
-
toRSL
Returns a RSL representation of this relation.
Note: Enable explicitConcat to generate more 'valid' RSL- Parameters:
explicitConcat- if true explicit concatination will be used in RSL strings.- Returns:
- RSL representation of this relation.
-
toRSL
Produces a RSL representation of node.- Parameters:
buf- buffer to add the RSL representation to.explicitConcat- if true explicit concatination will be used in RSL strings.
-
toString
-
canonicalize
-