|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.resmng.data.ConditionTreeOperator
public class ConditionTreeOperator
A class for the condition tree node that represents an operator. The operator
is either && or ||, and the operands - the children of the node - is a list
of either members of ConditionTreeCondition
or members of
ConditionTreeOperator.
Field Summary | |
---|---|
static int |
AND
A constant denoting the operator &&. |
protected java.util.ArrayList<IConditionTreeNode> |
children
The nodes that descend from this node in the condition tree. |
protected boolean |
defaultValue
The value returned by default when the node has not been evaluated (e.g. when the values to test against do not arrive). |
protected boolean |
hasBeenEvaluated
True if a call to evaluateNode() has been performed, and
false otherwise. |
(package private) static org.apache.log4j.Logger |
logger
|
protected int |
operator
The operator to be used when evaluating the condition node. |
static int |
OR
A constant denoting the operator ||. |
Constructor Summary | |
---|---|
ConditionTreeOperator(int operator)
|
Method Summary | |
---|---|
boolean |
evaluateNode(ResourceDescriptorRecord resource)
Evaluates the node according to the operator and the descending nodes. |
protected boolean |
evaluateNodeAnd(ResourceDescriptorRecord resource)
Evaluate the && node of the tree. |
protected boolean |
evaluateNodeOr(ResourceDescriptorRecord resource)
Evaluate the || node of the tree. |
double |
evaluateScore(ResourceDescriptorRecord resource)
Check the compliance of the input resource with the node of the condition subtree originating from this node, and evaluate the score of the resource. |
double |
evaluateScore(ResourceDescriptorRecord resource,
java.util.Hashtable<java.lang.Integer,java.lang.Double> attributeWeight)
Check the compliance of the input resource with the node of the condition subtree originating from this node, and evaluate the score of the resource. |
java.util.ArrayList<IConditionTreeNode> |
getChildren()
Retrieves the collection of nodes that descend from this node in the condition tree. |
boolean |
getDefaultValue()
|
boolean |
getHasBeenEvaluated()
|
int |
getOperator()
|
boolean |
getSubtreeScorekeeper(ResourceDescriptorRecord resource,
java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
The method builds a hash table of AttributeScorekeeper instances for each of the attribute that takes part in the subtree of the condition tree that starts at the provided node. |
protected boolean |
getSubtreeScorekeeperNodeAnd(ResourceDescriptorRecord resource,
java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
|
protected boolean |
getSubtreeScorekeeperNodeOr(ResourceDescriptorRecord resource,
java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
|
void |
setChildren(java.util.ArrayList<IConditionTreeNode> children)
Assigns a new collection of nodes to descend from this node in the condition tree. |
void |
setDefaultValue(boolean defaultValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
public static final int AND
public static final int OR
protected int operator
protected java.util.ArrayList<IConditionTreeNode> children
protected boolean defaultValue
protected boolean hasBeenEvaluated
evaluateNode()
has been performed, and
false otherwise.
Constructor Detail |
---|
public ConditionTreeOperator(int operator) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
Method Detail |
---|
public java.util.ArrayList<IConditionTreeNode> getChildren()
public void setChildren(java.util.ArrayList<IConditionTreeNode> children)
children
- The new collection representing the descending nodes
(children) of this node.protected boolean evaluateNodeAnd(ResourceDescriptorRecord resource)
resource
- The resource to check for compliance with the condition
subtree originating from this node.
protected boolean evaluateNodeOr(ResourceDescriptorRecord resource)
resource
- The resource to check for compliance with the condition
subtree originating from this node.
public boolean evaluateNode(ResourceDescriptorRecord resource) throws java.lang.IllegalArgumentException
evaluateNode
in interface IConditionTreeNode
resource
- The resource to check the compliance of.
java.lang.IllegalArgumentException
public double evaluateScore(ResourceDescriptorRecord resource) throws java.lang.IllegalArgumentException
evaluateScore
in interface IConditionTreeNode
resource
- The resource to check the compliance of.
java.lang.IllegalArgumentException
public double evaluateScore(ResourceDescriptorRecord resource, java.util.Hashtable<java.lang.Integer,java.lang.Double> attributeWeight) throws java.lang.IllegalArgumentException
IConditionTreeNode
evaluateScore
in interface IConditionTreeNode
resource
- The resource to check the compliance of.attributeWeight
- A hash table of pairs (attribute identifier,
the weight)
java.lang.IllegalArgumentException
protected boolean getSubtreeScorekeeperNodeAnd(ResourceDescriptorRecord resource, java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
protected boolean getSubtreeScorekeeperNodeOr(ResourceDescriptorRecord resource, java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
public boolean getSubtreeScorekeeper(ResourceDescriptorRecord resource, java.util.Hashtable<java.lang.Integer,AttributeScorekeeper> scorekeepers)
IConditionTreeNode
getSubtreeScorekeeper
in interface IConditionTreeNode
resource
- The resource record to get the scores of.scorekeepers
- The hash table that receives the attribute's scores.
The contents of the hash table will change during the call execution.
If the subtree yields that the record complies with the respective
subpart of the query, then the hash table should be updated with the
scores computed at the leaf nodes. If it yields non-complience, then
the attribute entries already in the hash table should be left intact,
and those encountered in the subtree that do not appear in the hash table
have to be tagged with negative scores and zero occurence counts.
public boolean getDefaultValue()
public void setDefaultValue(boolean defaultValue)
public boolean getHasBeenEvaluated()
public int getOperator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |