Package org.globus.rsl
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 TypeMethodDescriptionboolean
add
(AbstractRslNode node) Adds a rsl parse tree to this node.abstract boolean
abstract boolean
add
(NameOpValue relations) static String
canonicalize
(String str) Canonicalizes a string by removing any underscores and moving all characters to lowercase.evaluate()
Evalutes the rsl tree.abstract AbstractRslNode
Evalutes the rsl tree against the specified symbol table.abstract Bindings
getBindings
(String attribute) Returns the variable definitions associated wit the given attribute.int
Returns the node operator.Returns the operator as a string.static String
getOperatorAsString
(int op) Returns a string represention of a given operator.abstract NameOpValue
Returns the relation associated with the given attribute.Returns the list of sub-specifications.void
merge
(AbstractRslNode inNode) Merges the specified node with the current node.void
mergeTo
(AbstractRslNode dstNode) abstract Bindings
removeBindings
(String attribute) Removes a bindings list for the specified attribute.abstract NameOpValue
removeParam
(String attribute) Removes a relation for the specified attribute.boolean
Removes a specific sub-specification tree from the sub-specification list.void
setOperator
(int oper) Sets the operator.toRSL
(boolean explicitConcat) Returns a RSL representation of this relation.abstract void
toRSL
(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
Returns the variable definitions associated wit the given attribute.- Parameters:
attribute
- the attribute of the variable deinitions.- Returns:
- the variable deinitions for the attribute. Null, if not found.
-
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
Removes a bindings list for the specified attribute.- Parameters:
attribute
- the attribute name for the bindings.- Returns:
- the bindings that were removed.
-
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
Canonicalizes a string by removing any underscores and moving all characters to lowercase.- Parameters:
str
- string to canonicalize- Returns:
- canonicalized string
-