net.sourceforge.domian.specification
Class JointDenialSpecification<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.JointDenialSpecification<T>
All Implemented Interfaces:
CompositeSpecification<T>, Specification<T>

final class JointDenialSpecification<T>
extends AbstractCompositeSpecification<T>

A joint denial specification where none of the wrapped specifications must be satisfied for this overall composite specification to be satisfied.

The boolean logic operator equivalent is NOR.

Since:
0.2
Author:
Eirik Torske

Field Summary
 
Fields inherited from class net.sourceforge.domian.specification.AbstractCompositeSpecification
specifications
 
Fields inherited from class net.sourceforge.domian.specification.AbstractSpecification
type
 
Constructor Summary
JointDenialSpecification(java.lang.Class<T> type)
           
 
Method Summary
 java.lang.Boolean isDisjointWith(Specification<?> specification)
           
 java.lang.Boolean isSatisfiedBy(T candidate)
           
protected  java.lang.Boolean isSpecifyingAllInstancesOfItsType()
           
(package private)  java.lang.Boolean isTypeExcludingSpecification()
           
protected  AbstractSpecification<T> purify(boolean doPurifyInversions)
          Purify this specification.
private  AbstractSpecification<T> purifyWithoutAnyInversionOfWrappedSpecs()
           
 
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 net.sourceforge.domian.specification.AbstractSpecification
containsSimpleCompositesOnly, containsValueBoundSpecificationsOnly, createValueBoundSpecification, getNegatedSpecification, getNumberOfLevelsOfNegations, getType, intersectsWith, invert, isIntersectionOf, isInvertible, isOddNumber, 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

JointDenialSpecification

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

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

isTypeExcludingSpecification

java.lang.Boolean isTypeExcludingSpecification()
Returns:
true if this NOR specification excludes all possibilities for satisfaction of candidate objects having this specification's 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>

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

purifyWithoutAnyInversionOfWrappedSpecs

private AbstractSpecification<T> purifyWithoutAnyInversionOfWrappedSpecs()


Copyright © 2006-2010. All Rights Reserved.