net.sourceforge.domian.specification
Class DisjuntionSpecification<T>

java.lang.Object
  extended by net.sourceforge.domian.specification.AbstractSpecification<T>
      extended by net.sourceforge.domian.specification.AbstractCompositeSpecification<T>
          extended by net.sourceforge.domian.specification.DisjuntionSpecification<T>
All Implemented Interfaces:
CompositeSpecification<T>, Specification<T>

final class DisjuntionSpecification<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

Field Summary
 
Fields inherited from class net.sourceforge.domian.specification.AbstractCompositeSpecification
parameterizedSpecificationWithDisjunctionSpec, specifications
 
Fields inherited from class net.sourceforge.domian.specification.AbstractSpecification
type
 
Constructor Summary
DisjuntionSpecification(java.lang.Class<T> type)
           
 
Method Summary
 java.lang.Boolean isSatisfiedBy(T candidate)
          Specification satisfaction.
(package private)  java.lang.Boolean isSpecifyingAllInstancesOfItsType()
           
 
Methods inherited from class net.sourceforge.domian.specification.AbstractCompositeSpecification
and, and, equals, getAccessibleObjectNameList, getAllSpecifications, getLeafSpecificationMap, hasConjunction, hasDisjunction, hashCode, isDisjointWith, isGeneralizationOf, isSpecialCaseOf, or, or, remainderUnsatisfiedBy, where, wrapWithNewSpecification
 
Methods inherited from class net.sourceforge.domian.specification.AbstractSpecification
getType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.domian.specification.Specification
getType
 

Constructor Detail

DisjuntionSpecification

DisjuntionSpecification(java.lang.Class<T> type)
Method Detail

isSpecifyingAllInstancesOfItsType

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

isSatisfiedBy

public java.lang.Boolean isSatisfiedBy(T candidate)
Description copied from interface: Specification
Specification satisfaction.

Specified by:
isSatisfiedBy in interface Specification<T>
Overrides:
isSatisfiedBy in class AbstractCompositeSpecification<T>
Parameters:
candidate - The candidate object
Returns:
true only if this specification is satisfied by/approves the given candidate (null is never approved)


Copyright © 2006-2009. All Rights Reserved.