org.nakedobjects.applib.spec
Class SpecificationAnd

java.lang.Object
  extended by org.nakedobjects.applib.spec.SpecificationAnd
All Implemented Interfaces:
Specification

public abstract class SpecificationAnd
extends Object
implements Specification

Adapter to make it easy to perform boolean algebra on Specifications.

Subclasses represent the intersection of multiple Specifications. An implementation should instantiate the Specifications to be satisfied in its constructor.

For example:

 public class MilkAndSugarSpec extends SpecificationAnd {
     public MilkAndSugarSpec() {
         super(
             new MustBeMilkySpec(), 
             new TwoLumpsOfSugarSpec()
         );
     }
 }
 

See Also:
SpecificationOr, SpecificationNot

Constructor Summary
SpecificationAnd(Specification... specifications)
           
 
Method Summary
 String satisfies(Object obj)
          If null then satisfied, otherwise is reason why the specification is not satisfied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecificationAnd

public SpecificationAnd(Specification... specifications)
Method Detail

satisfies

public String satisfies(Object obj)
Description copied from interface: Specification
If null then satisfied, otherwise is reason why the specification is not satisfied.

Specified by:
satisfies in interface Specification


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.