com.tensegrity.generic.constraint
Class OpenEnumConstraint

java.lang.Object
  extended bycom.tensegrity.generic.constraint.AbstractConstraint
      extended bycom.tensegrity.generic.constraint.EnumConstraint
          extended bycom.tensegrity.generic.constraint.OpenEnumConstraint
All Implemented Interfaces:
Constraint

public class OpenEnumConstraint
extends EnumConstraint

*

The class OpenEnumConstraint provides the same functionality and comes with the same behaviour as the EnumConstraint class.
The difference between them is that the OpenEnumConstraint allows values that are not part of the given list of alternatives. In other words the OpenEnumConstraint allows any value but provides a list of alternatives.

Version:
$Id$
Author:
MKegel

Field Summary
 
Fields inherited from class com.tensegrity.generic.constraint.EnumConstraint
lastError
 
Constructor Summary
OpenEnumConstraint(java.lang.Object[] enumeration)
          Constructor with list of alternatives given by enumeration.
 
Method Summary
 boolean validate(java.lang.Object value)
          Validates this contraint against a given value.
 
Methods inherited from class com.tensegrity.generic.constraint.EnumConstraint
getAlternatives, intern, toString, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenEnumConstraint

public OpenEnumConstraint(java.lang.Object[] enumeration)
Constructor with list of alternatives given by enumeration.

Parameters:
enumeration - the list of alternatives
Method Detail

validate

public boolean validate(java.lang.Object value)
Description copied from interface: Constraint
Validates this contraint against a given value.
Notice:The given argument may not be null.

Specified by:
validate in interface Constraint
Overrides:
validate in class EnumConstraint


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.