org.jppf.node.policy
Class OneOf

java.lang.Object
  extended by org.jppf.node.policy.ExecutionPolicy
      extended by org.jppf.node.policy.OneOf
All Implemented Interfaces:
Serializable

public class OneOf
extends ExecutionPolicy

An execution policy rule that encapsulates a test of type property_value is one of [value1, ··· , valueN]. The test applies to numeric and string values only.

Author:
Laurent Cohen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jppf.node.policy.ExecutionPolicy
ExecutionPolicy.AndRule, ExecutionPolicy.LogicalRule, ExecutionPolicy.NotRule, ExecutionPolicy.OrRule, ExecutionPolicy.XorRule
 
Field Summary
 
Fields inherited from class org.jppf.node.policy.ExecutionPolicy
computedToString
 
Constructor Summary
OneOf(String propertyName, boolean ignoreCase, String... values)
          Define an equality comparison between the numeric value of a property and another numeric value.
OneOf(String propertyName, double... values)
          Define an equality comparison between the numeric value of a property and another numeric value.
 
Method Summary
 boolean accepts(JPPFSystemInformation info)
          Determines whether this policy accepts the specified node.
 String toString()
          Print this object to a string.
 
Methods inherited from class org.jppf.node.policy.ExecutionPolicy
and, getProperty, indent, not, or, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OneOf

public OneOf(String propertyName,
             double... values)
Define an equality comparison between the numeric value of a property and another numeric value.

Parameters:
propertyName - the name of the property to compare.
values - the values to compare with.

OneOf

public OneOf(String propertyName,
             boolean ignoreCase,
             String... values)
Define an equality comparison between the numeric value of a property and another numeric value.

Parameters:
propertyName - the name of the property to compare.
ignoreCase - determines if the comparison should ignore the string case.
values - the values to compare with.
Method Detail

accepts

public boolean accepts(JPPFSystemInformation info)
Determines whether this policy accepts the specified node.

Specified by:
accepts in class ExecutionPolicy
Parameters:
info - system information for the node on which the tasks will run if accepted.
Returns:
true if the node is accepted, false otherwise.
See Also:
ExecutionPolicy.accepts(org.jppf.management.JPPFSystemInformation)

toString

public String toString()
Print this object to a string.

Overrides:
toString in class Object
Returns:
an XML string representation of this object
See Also:
Object.toString()


Copyright © 2005-2010 JPPF Team.