net.sourceforge.domian.specification
Class AbstractValueBoundSpecification<T>
java.lang.Object
net.sourceforge.domian.specification.AbstractSpecification<T>
net.sourceforge.domian.specification.AbstractValueBoundSpecification<T>
- All Implemented Interfaces:
- LeafSpecification<T>, Specification<T>, ValueBoundSpecification<T>
- Direct Known Subclasses:
- AbstractComparableValueBoundSpecification, EqualIgnoreCaseStringSpecification, EqualSpecification, NotEqualSpecification
abstract class AbstractValueBoundSpecification<T>
- extends AbstractSpecification<T>
- implements ValueBoundSpecification<T>
An abstract superclass for value bound specifications.
This class defines the data structure of Domian value bound specifications, consisting of:
The type of this Specification
(parameterized as T
)
The object/value of type T
that is bound to this specification
A strategy on how to use the value object for candidate object approval (sublassed strategies of this class)
All objects given and then bound to this class are cloned, ensuring specification object immutability.
- Since:
- 0.1
- Author:
- Eirik Torske
- See Also:
ReflectionUtils.cloneOrDeepCopyIfNotImmutable(java.lang.Object)
,
ReflectionUtils.DO_COPY_OBJECTS
,
ReflectionUtils.RECURSIVE_COPYING_DEPTH_TRESHOLD
Methods inherited from class net.sourceforge.domian.specification.AbstractSpecification |
and, containsSimpleCompositesOnly, containsValueBoundSpecificationsOnly, createValueBoundSpecification, getAllSpecifications, getNegatedSpecification, getNumberOfLevelsOfNegations, getType, hasConjunction, hasDisjunction, intersectsWith, isGeneralizationOf, isIntersectionOf, isInvertible, isOddNumber, isSpecialCaseOf, or, purify, toString, where |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
value
protected final T value
originalValue
protected final T originalValue
AbstractValueBoundSpecification
AbstractValueBoundSpecification(T value)
getValue
public T getValue()
- Specified by:
getValue
in interface ValueBoundSpecification<T>
getBinaryRelation
protected RelationalOperator getBinaryRelation()
- Returns:
- the mathematical binary relation bound to this value bound specification
- Since:
- 0.5
getBinaryRelation
protected abstract RelationalOperator getBinaryRelation(java.lang.Boolean negated)
- Parameters:
negated
- when true
the returned binary relation will be inverted
- Returns:
- the mathematical binary relation bound to this value bound specification
- Since:
- 0.5
getDisjointDecision
protected abstract java.lang.Boolean getDisjointDecision(RelationalOperator candidateRelationalOperator,
T candidateOperandValue)
- Returns:
true
if the given candidate relation/operand pair leads to a disjoint relationship with this value bound specification- Since:
- 0.5
isDisjointWith
public java.lang.Boolean isDisjointWith(Specification<?> specification)
- Specified by:
isDisjointWith
in interface Specification<T>
- Overrides:
isDisjointWith
in class AbstractSpecification<T>
invert
protected Specification<T> invert()
- Overrides:
invert
in class AbstractSpecification<T>
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object otherObject)
- Overrides:
equals
in class java.lang.Object
Copyright © 2006-2010. All Rights Reserved.