net.sourceforge.domian.specification
Class DisjunctionSpecification<T>
java.lang.Object
net.sourceforge.domian.specification.AbstractSpecification<T>
net.sourceforge.domian.specification.AbstractCompositeSpecification<T>
net.sourceforge.domian.specification.DisjunctionSpecification<T>
- All Implemented Interfaces:
- CompositeSpecification<T>, Specification<T>
final class DisjunctionSpecification<T>
- extends AbstractCompositeSpecification<T>
A composite specification where at least one of the wrapped specifications
must be satisfied for this overall composite specification to be satisfied.
The boolean logic operator equivalent is OR.
- Since:
- 0.1
- Author:
- Eirik Torske
Methods inherited from class net.sourceforge.domian.specification.AbstractCompositeSpecification |
and, and, equals, finalizeCreation, getAccessibleObjectNameList, getAllSpecifications, getAllSpecifications, getLeafSpecificationMap, hasConjunction, hasDisjunction, hashCode, hasParameterization, isGeneralizationOf, isSimpleComposition, isSpecialCaseOf, or, or, remainderUnsatisfiedBy, where, wrapWithNewSpecification |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
DisjunctionSpecification
DisjunctionSpecification(java.lang.Class<T> type)
isSatisfiedBy
public java.lang.Boolean isSatisfiedBy(T candidate)
- Specified by:
isSatisfiedBy
in interface Specification<T>
- Overrides:
isSatisfiedBy
in class AbstractCompositeSpecification<T>
isDisjointWith
public java.lang.Boolean isDisjointWith(Specification<?> specification)
- Specified by:
isDisjointWith
in interface Specification<T>
- Overrides:
isDisjointWith
in class AbstractSpecification<T>
isSpecifyingAllInstancesOfItsType
protected java.lang.Boolean isSpecifyingAllInstancesOfItsType()
- Specified by:
isSpecifyingAllInstancesOfItsType
in class AbstractCompositeSpecification<T>
- Returns:
true
if this specification will approve all possible instances of its declared type
purify
protected AbstractSpecification<T> purify(boolean doPurifyInversions)
- Description copied from class:
AbstractSpecification
- Purify this specification.
This may imply both simplification of the specification object graph,
as well as applying boolean algebra on the overall logical expression.
- Overrides:
purify
in class AbstractSpecification<T>
- Parameters:
doPurifyInversions
- if false
leave inversions alone (they must be purified only when spec creation is completed)
- Returns:
- a purified specification
isInvertible
protected java.lang.Boolean isInvertible()
- Overrides:
isInvertible
in class AbstractSpecification<T>
invert
protected Specification<T> invert()
- Overrides:
invert
in class AbstractSpecification<T>
doBooleanAlgebraInversion
private Specification<T> doBooleanAlgebraInversion()
Copyright © 2006-2010. All Rights Reserved.