|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.utilities.resmng.ConditionTreeBuilder
public class ConditionTreeBuilder
A helper class for building condition trees for resource matching queries.
Field Summary | |
---|---|
(package private) static org.apache.log4j.Logger |
logger
|
static java.lang.String |
ValueKey
|
Constructor Summary | |
---|---|
ConditionTreeBuilder()
|
Method Summary | |
---|---|
static IConditionTreeNode |
buildTree(ParsedCommand xconsoleCommand)
|
static IConditionTreeNode |
buildTreeFromJSDL(java.util.Hashtable<java.lang.String,java.lang.Object> jsdl)
Builds a condition tree from a structure representing an XML formatted according to the JSDL schema. |
static void |
dumpConditionTree(IConditionTreeNode node)
A helper method for dumping a tree starting at the provided node to stdout. |
protected static void |
dumpConditionTree(IConditionTreeNode node,
int level)
A helper method for dumping a subtree at a certain depth level. |
private static boolean |
getBoundExclusive(java.lang.Object bound)
Checks if the bound expressed by the RangeValue_Type should be exclusive. |
protected static double |
getBoundValue(java.lang.Object bound,
java.lang.String key)
Extracts the bound value from the hashtable representing a RangeValue_type. |
protected static java.lang.String |
getElementValue(java.lang.Object element)
Extract the value from the element that is assumed to be the leaf node in the XML structure. |
private static IConditionTreeNode |
getExactSubtree(java.lang.Object exact,
int nodeAttribute)
Returns a subtree that checks whether the value matches the condition represented by Exact_type structure. |
protected static IConditionTreeNode |
getMatchInterval(java.lang.String refValues,
int nodeAttribute)
|
protected static IConditionTreeNode |
getMatchRangeConditionNode(java.util.ArrayList list,
int nodeAttribute)
Generate a condition subtree representing the range structure of a JSDL. |
protected static IConditionTreeNode |
getMatchStringNode(java.util.ArrayList list,
int nodeAttribute)
|
protected static INodeEvaluation |
getNodeEvaluation(int nodeAttribute)
A helper method for creating attribute-type-dependent functions for evaluating the records by the attribute values. |
private static IConditionTreeNode |
getRangeSubtree(java.lang.Object range,
int nodeAttribute)
Returns a subtree that checks whether the value is within one of the intervals provided in the Range_type JSDL structure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ValueKey
static org.apache.log4j.Logger logger
Constructor Detail |
---|
public ConditionTreeBuilder()
Method Detail |
---|
public static IConditionTreeNode buildTreeFromJSDL(java.util.Hashtable<java.lang.String,java.lang.Object> jsdl)
jsdl
- The structure containing the JSLD-formatted XML.
ConditionTreeOperator
representing an && operator. If only one
structure exists, the return value is a parent of the subtree
representing the structure. If no valid structures exist within JSDL,
the function returns null.protected static double getBoundValue(java.lang.Object bound, java.lang.String key)
bound
- A RangeValue_type structure that can either be the end value
or a hashtable representing the structure.key
- The name of the type of the bound.
protected static java.lang.String getElementValue(java.lang.Object element)
element
- The element to extract the value from. Should be of
type String or a Hashtableprivate static boolean getBoundExclusive(java.lang.Object bound)
bound
- A RangeValue_type structure that can either be the end value
or a hashtable representing the structure.
private static IConditionTreeNode getExactSubtree(java.lang.Object exact, int nodeAttribute)
exact
- The Exact_type structure.nodeAttribute
- The identifier denoting which attribute of
the JSDL / GLUE the condition refers to.
private static IConditionTreeNode getRangeSubtree(java.lang.Object range, int nodeAttribute)
range
- A Range_type structure containing an arraylist or a
hashtable of ranges.nodeAttribute
- The identifier denoting which attribute of
the JSDL / GLUE the condition refers to.
protected static IConditionTreeNode getMatchRangeConditionNode(java.util.ArrayList list, int nodeAttribute)
list
- The ArrayList containing the XML substructure representing
the RangeType.nodeAttribute
- The identifier denoting which attribute of
the JSDL / GLUE the condition refers to.
protected static INodeEvaluation getNodeEvaluation(int nodeAttribute)
nodeAttribute
- The attribute to initialise the evaluation function
for.
protected static IConditionTreeNode getMatchStringNode(java.util.ArrayList list, int nodeAttribute)
public static void dumpConditionTree(IConditionTreeNode node)
node
- The node to start the dumping of the tree at.protected static void dumpConditionTree(IConditionTreeNode node, int level)
node
- The node to start the dumping of the tree at.level
- The node's depth (0 - root, 1 - child of the root, etc.),
reflected in the level of indentation of the dump.public static IConditionTreeNode buildTree(ParsedCommand xconsoleCommand)
protected static IConditionTreeNode getMatchInterval(java.lang.String refValues, int nodeAttribute)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |