net.sourceforge.domian.specification
Class CollectionSpecification<F>
java.lang.Object
net.sourceforge.domian.specification.AbstractSpecification<java.util.Collection<F>>
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 Collection
s.
This specifications has three scopes,
described by an internal enum class:
number of collection elements (collection size)
number of collection elements satisfying a given element specification
percentage of collection elements satisfying a given element specification
- 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()
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 |
collectionSpecificationScope
private final CollectionSpecification.CollectionSpecificationScope collectionSpecificationScope
collectionSpecification
private final Specification<java.lang.Integer> collectionSpecification
elementSpecification
private Specification<F> elementSpecification
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)
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.