Package generic.constraint
Class Constraint<T>
java.lang.Object
generic.constraint.Constraint<T>
- Type Parameters:
T
- The type of object that decisions will be made.
- Direct Known Subclasses:
ProgramConstraint
Constraints are used to make decisions to traverse a decision tree where each node in the
tree has a constraint that is used to decide if that node is part of the successful decision path.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
abstract String
Returns a description of this constraint (with its configuration data) to be used to journal the decision path that was taken.final String
getName()
Returns the name of the constraint.abstract boolean
isSatisfied
(T t) Returns true if the given object satisfies this constraint.abstract void
Initialized this constraint state.
-
Constructor Details
-
Constraint
Constructor takes the name of the constraint. This name will be tag used in the XML specification file.- Parameters:
name
- the name of the constraint
-
-
Method Details
-
getName
Returns the name of the constraint. Note: this name is also the XML tag used in the constraints specification files.- Returns:
- the name of the constraint
-
isSatisfied
Returns true if the given object satisfies this constraint.- Parameters:
t
- the object to test this constraint on.- Returns:
- true if the given object satisfies this constraint.
-
loadConstraintData
Initialized this constraint state. Attributes in the xml element with this constaints tag name will be extracted into the ConstraintData object for easy retrieval.- Parameters:
data
- the ConstraintData object used to initialize this constraint.
-
equals
-
getDescription
Returns a description of this constraint (with its configuration data) to be used to journal the decision path that was taken.- Returns:
- a description of this constraint with its configuration data.
-