net.sourceforge.domian.specification
Class CollectionSpecification<F>

java.lang.Object
  extended by net.sourceforge.domian.specification.AbstractSpecification<java.util.Collection<F>>
      extended by net.sourceforge.domian.specification.CollectionSpecification<F>
All Implemented Interfaces:
LeafSpecification<java.util.Collection<F>>, Specification<java.util.Collection<F>>

final class CollectionSpecification<F>
extends AbstractSpecification<java.util.Collection<F>>
implements LeafSpecification<java.util.Collection<F>>

Specification for Collections.

This specifications has three scopes, described by an internal enum class:

Since:
0.2
Author:
Eirik Torske
See Also:
SpecificationFactory.hasSize(), SpecificationFactory.haveSize(), SpecificationFactory.hasSizeOf(), SpecificationFactory.haveSizeOf(), SpecificationFactory.isEmpty(), SpecificationFactory.include(), SpecificationFactory.includes(), SpecificationFactory.includeAPercentageOf(), SpecificationFactory.includesAPercentageOf()

Nested Class Summary
(package private) static class CollectionSpecification.CollectionSpecificationScope
           
 
Field Summary
private  Specification<java.lang.Integer> collectionSpecification
           
private  CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope
           
private  Specification<F> elementSpecification
           
 
Fields inherited from class net.sourceforge.domian.specification.AbstractSpecification
type
 
Constructor Summary
CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope, Specification<java.lang.Integer> collectionSpecification)
           
CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope, Specification<java.lang.Integer> collectionSpecification, java.lang.Class<F> elementType)
           
CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope, Specification<java.lang.Integer> collectionSpecification, Specification<F> elementSpecification)
           
 
Method Summary
 boolean equals(java.lang.Object otherObject)
           
 Specification<java.lang.Integer> getCollectionSpecification()
           
 CollectionSpecification.CollectionSpecificationScope getCollectionSpecificationScope()
           
 Specification<F> getElementSpecification()
           
 java.lang.Class<java.util.Collection<F>> getType()
           
 int hashCode()
           
private  boolean isEqualBoundCollectionSpecification()
           
private  boolean isLowerBoundCollectionSpecification()
           
private  boolean isNegatedCollectionSpecification()
           
 java.lang.Boolean isSatisfiedBy(java.util.Collection<F> candidate)
           
private  boolean isUpperBoundCollectionSpecification()
           
 
Methods inherited from class net.sourceforge.domian.specification.AbstractSpecification
and, containsSimpleCompositesOnly, containsValueBoundSpecificationsOnly, createValueBoundSpecification, getAllSpecifications, getNegatedSpecification, getNumberOfLevelsOfNegations, hasConjunction, hasDisjunction, intersectsWith, invert, isDisjointWith, isGeneralizationOf, isIntersectionOf, isInvertible, isOddNumber, isSpecialCaseOf, or, purify, toString, where
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.domian.specification.Specification
and, isDisjointWith, isGeneralizationOf, isSpecialCaseOf, or, where
 

Field Detail

collectionSpecificationScope

private final CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope

collectionSpecification

private final Specification<java.lang.Integer> collectionSpecification

elementSpecification

private Specification<F> elementSpecification
Constructor Detail

CollectionSpecification

CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope,
                        Specification<java.lang.Integer> collectionSpecification)

CollectionSpecification

CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope,
                        Specification<java.lang.Integer> collectionSpecification,
                        java.lang.Class<F> elementType)

CollectionSpecification

CollectionSpecification(CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope,
                        Specification<java.lang.Integer> collectionSpecification,
                        Specification<F> elementSpecification)
Method Detail

getType

public java.lang.Class<java.util.Collection<F>> getType()
Specified by:
getType in interface Specification<java.util.Collection<F>>
Overrides:
getType in class AbstractSpecification<java.util.Collection<F>>

isSatisfiedBy

public java.lang.Boolean isSatisfiedBy(java.util.Collection<F> candidate)
Specified by:
isSatisfiedBy in interface Specification<java.util.Collection<F>>

getCollectionSpecificationScope

public CollectionSpecification.CollectionSpecificationScope getCollectionSpecificationScope()

getCollectionSpecification

public Specification<java.lang.Integer> getCollectionSpecification()

getElementSpecification

public Specification<F> getElementSpecification()

isLowerBoundCollectionSpecification

private boolean isLowerBoundCollectionSpecification()

isEqualBoundCollectionSpecification

private boolean isEqualBoundCollectionSpecification()

isUpperBoundCollectionSpecification

private boolean isUpperBoundCollectionSpecification()

isNegatedCollectionSpecification

private boolean isNegatedCollectionSpecification()

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.