|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ace.moab.api.node.FunctionExpression
public class FunctionExpression
This class represents a node priority function expression, which is a part of any priority function. An expression is simply an attribute multiplied by a factor. A complete function can have any number of expressions, although it is useless to have multiple expressions that have the same attribute.
Constructor Summary | |
---|---|
FunctionExpression()
Default constructor. |
|
FunctionExpression(PriorityComponent attribute,
double factor)
Constructor that creates a complete Function Expression. |
Method Summary | |
---|---|
int |
compareTo(FunctionExpression o)
|
double |
evaluateForNode(MoabNode node)
Evaluates this function expression for a given node. |
PriorityComponent |
getAttribute()
Get the attribute of a node that is evaluated to a numerical value. |
double |
getFactor()
Get the value that is multiplied to the attribute to evaluate the expression. |
static FunctionExpression |
parseExpression(java.lang.String exprString)
Parses a function expression from a Moab string. |
void |
setAttribute(PriorityComponent attribute)
Sets the attribute of the function expression. |
void |
setFactor(double factor)
Sets the factor (coefficient) of the function expression. |
java.lang.String |
toMoabString()
Reports the function expression in a Moab-parsable string format. |
java.lang.String |
toString()
Reports the function expression in a human-readable string format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FunctionExpression()
public FunctionExpression(PriorityComponent attribute, double factor)
Constructor that creates a complete Function Expression. This sets the attribute and factor attributes of the function expression.
The attribute must be a valid PriorityComponent whose corresponding
NodeTableColumn attribute is a Numerical Type or an
IllegalArgumentException
will be thrown.
attribute
- the attribute of the expression.factor
- the factor (coefficient) of the expression.Method Detail |
---|
public int compareTo(FunctionExpression o)
compareTo
in interface java.lang.Comparable<FunctionExpression>
public double evaluateForNode(MoabNode node)
Evaluates this function expression for a given node. This function
determines the value of the attribute
field for the node,
and then multiplies this value by the factor
.
If the attribute
of this priority function is a boolean
value, this method returns 1 for the attribute value, and the result is
simply the factor value.
node
- The MoabNode which contains actual values for various
attributes that will be used to evaluate the value of this
expression.
public PriorityComponent getAttribute()
Get the attribute of a node that is evaluated to a numerical value.
public double getFactor()
Get the value that is multiplied to the attribute to evaluate the expression.
public void setAttribute(PriorityComponent attribute)
Sets the attribute of the function expression.
The attribute must be a valid PriorityComponent whose corresponding
NodeTableColumn attribute is a Numerical Type or an
IllegalArgumentException
will be thrown.
attribute
- The attribute of the function expression.public void setFactor(double factor)
Sets the factor (coefficient) of the function expression.
factor
- The factor (coefficient) of the function expression.public static FunctionExpression parseExpression(java.lang.String exprString) throws java.text.ParseException
PriorityComponent
attributes.
exprString
- String representing a function expression.
java.text.ParseException
public java.lang.String toMoabString()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |