Package org.jppf.node.policy
Class OneOf
java.lang.Object
org.jppf.node.policy.ExecutionPolicy
org.jppf.node.policy.OneOf
- All Implemented Interfaces:
Serializable
An execution policy rule that encapsulates a test of type property_value_or_expression is one of [value1, ··· , valueN].
The test applies to numeric and string values.
- Author:
- Laurent Cohen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jppf.node.policy.ExecutionPolicy
ExecutionPolicy.AndRule, ExecutionPolicy.NotRule, ExecutionPolicy.OrRule, ExecutionPolicy.XorRule -
Field Summary
Fields inherited from class org.jppf.node.policy.ExecutionPolicy
children -
Constructor Summary
ConstructorsConstructorDescriptionDetermine whether the value of a property, expressed as aString, is in the specified array of values.Determine whether the value of a property, expressed as adouble, is in the specified array of values.Determine whether the value of a property, expressed as adouble, is in the specified array of values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(PropertiesCollection<String> info) Determines whether this policy accepts the specified node.protected ObjectgetLeftOperandValue(PropertiesCollection<String> properties) toString(int n) Print this object to a string.Methods inherited from class org.jppf.node.policy.ExecutionPolicy
and, and, andNot, andNot, checkRules, evaluate, getChildren, getContext, getProperty, indent, negate, not, Not, or, or, orNot, orNot, setContext, setContext, tagEnd, tagStart, toString, toXML, xmlElement, xmlElement, xor, xor
-
Constructor Details
-
OneOf
Determine whether the value of a property, expressed as adouble, is in the specified array of values.- Parameters:
propertyNameOrExpression- either a literal string which represents a property name, or an expression resolving to a numeric value.values- the values to compare with.
-
OneOf
Determine whether the value of a property, expressed as adouble, is in the specified array of values.- Parameters:
propertyNameOrExpression- either a literal string which represents a property name, or an expression resolving to a numeric value.values- expressions resolving to double values to compare with.
-
OneOf
Determine whether the value of a property, expressed as aString, is in the specified array of values.- Parameters:
propertyNameOrExpression- either a literal string which represents a property name, or an expression resolving to a numeric value.ignoreCase- determines if the comparison should ignore the string case.values- the values or expressions resolving to strings to compare with.
-
-
Method Details
-
accepts
Determines whether this policy accepts the specified node.- Specified by:
acceptsin classExecutionPolicy- Parameters:
info- system information for the node on which the tasks will run if accepted.- Returns:
- true if the node is accepted, false otherwise.
-
toString
Print this object to a string.- Specified by:
toStringin classExecutionPolicy- Parameters:
n- the size of the indent to startwith.- Returns:
- an XML string representation of this object
-
getLeftOperandValue
- Parameters:
properties- the proeprties collection to evaluate against.- Returns:
- the typed value of the left operand expression.
-