Package org.globus.rsl
Class RslNode
- java.lang.Object
-
- org.globus.rsl.AbstractRslNode
-
- org.globus.rsl.RslNode
-
public class RslNode extends AbstractRslNode
This class represents a RSL parse tree. It is composed of variable definitions (bindings), relations, and sub-specifications (sub nodes).
-
-
Field Summary
Fields Modifier and Type Field Description protected Map
_bindings
protected Map
_relations
-
Fields inherited from class org.globus.rsl.AbstractRslNode
_operator, _specifications, AND, MULTI, OR
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Bindings bindings)
boolean
add(NameOpValue relation)
AbstractRslNode
evaluate(Map symbolTable)
Evalutes the rsl tree against the specified symbol table.Map
getBindings()
Returns the variable definitions.Bindings
getBindings(String attribute)
Returns the variable definitions associated wit the given attribute.NameOpValue
getParam(String attribute)
Returns the relation associated with the given attribute.Map
getRelations()
Returns the relations.void
mergeTo(AbstractRslNode dstNode)
Bindings
put(Bindings bindings)
NameOpValue
put(NameOpValue relation)
Bindings
removeBindings(String attribute)
Removes a bindings list for the specified attribute.NameOpValue
removeParam(String attribute)
Removes a relation for the specified attribute.void
toRSL(StringBuffer buf, boolean explicitConcat)
Produces a RSL representation of node.-
Methods inherited from class org.globus.rsl.AbstractRslNode
add, canonicalize, evaluate, getOperator, getOperatorAsString, getOperatorAsString, getSpecifications, merge, removeSpecification, setOperator, toRSL, toString
-
-
-
-
Method Detail
-
add
public boolean add(Bindings bindings)
- Specified by:
add
in classAbstractRslNode
-
put
public NameOpValue put(NameOpValue relation)
-
add
public boolean add(NameOpValue relation)
- Specified by:
add
in classAbstractRslNode
-
mergeTo
public void mergeTo(AbstractRslNode dstNode)
- Overrides:
mergeTo
in classAbstractRslNode
-
getParam
public NameOpValue getParam(String attribute)
Returns the relation associated with the given attribute.- Specified by:
getParam
in classAbstractRslNode
- Parameters:
attribute
- the attribute of the relation.- Returns:
- the relation for the attribute. Null, if not found.
-
getBindings
public Bindings getBindings(String attribute)
Returns the variable definitions associated wit the given attribute.- Specified by:
getBindings
in classAbstractRslNode
- Parameters:
attribute
- the attribute of the variable deinitions.- Returns:
- the variable deinitions for the attribute. Null, if not found.
-
removeParam
public NameOpValue removeParam(String attribute)
Removes a relation for the specified attribute.- Specified by:
removeParam
in classAbstractRslNode
- Parameters:
attribute
- the attribute name for the relation to remove.- Returns:
- the relation that was removed.
-
removeBindings
public Bindings removeBindings(String attribute)
Removes a bindings list for the specified attribute.- Specified by:
removeBindings
in classAbstractRslNode
- Parameters:
attribute
- the attribute name for the bindings.- Returns:
- the bindings that were removed.
-
getRelations
public Map getRelations()
Returns the relations.- Returns:
- the map of relations.
-
getBindings
public Map getBindings()
Returns the variable definitions.- Returns:
- the map of variable definitions.
-
evaluate
public AbstractRslNode evaluate(Map symbolTable) throws RslEvaluationException
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.- Specified by:
evaluate
in classAbstractRslNode
- Parameters:
symbolTable
- the symbol table to evalute variables against.- Returns:
- the evaluated rsl tree.
- Throws:
RslEvaluationException
- If an error occured during rsl evaluation.
-
toRSL
public void toRSL(StringBuffer buf, boolean explicitConcat)
Produces a RSL representation of node.- Specified by:
toRSL
in classAbstractRslNode
- Parameters:
buf
- buffer to add the RSL representation to.explicitConcat
- if true explicit concatination will be used in RSL strings.
-
-