|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.CollectionConstraint.Contains
CollectionConstraint which validates a portion of a Collection.
Accepts only collections where the number of members matching
the PropertyConstraint
is in the supplied cardinality.
A typical application for this would be with Annotations where
one property can contain a number of synonyms.
CollectionConstraint.Contains
could be used as
a query to select instances based on one of these synonyms.
Nested Class Summary |
Nested classes inherited from class org.biojava.bio.CollectionConstraint |
CollectionConstraint.AllValuesIn, CollectionConstraint.And, CollectionConstraint.Contains, CollectionConstraint.Or |
Field Summary |
Fields inherited from interface org.biojava.bio.CollectionConstraint |
ANY, EMPTY, NONE |
Constructor Summary | |
CollectionConstraint.Contains(PropertyConstraint pc,
Location card)
|
Method Summary | |
boolean |
accept(java.lang.Object o)
accept returns true if the value fulfills the
constraint. |
boolean |
equals(java.lang.Object o)
|
Location |
getCardinalityConstraint()
|
PropertyConstraint |
getPropertyConstraint()
|
int |
hashCode()
|
boolean |
subConstraintOf(CollectionConstraint cc)
subConstraintOf returns true if the constraint
is a sub-constraint. |
java.lang.String |
toString()
|
boolean |
validateAddValue(java.util.Collection oldCol,
java.lang.Object newValue)
Return true iff the Collection formed by adding
newValue to current would be accepted
by this constraint. |
boolean |
validateRemoveValue(java.util.Collection oldCol,
java.lang.Object newValue)
Return true iff the Collection formed by removing
newValue from current would be accepted
by this constraint. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CollectionConstraint.Contains(PropertyConstraint pc, Location card)
Method Detail |
public PropertyConstraint getPropertyConstraint()
public Location getCardinalityConstraint()
public boolean accept(java.lang.Object o)
CollectionConstraint
accept
returns true if the value fulfills the
constraint.
accept
in interface CollectionConstraint
public int hashCode()
public boolean equals(java.lang.Object o)
public boolean validateAddValue(java.util.Collection oldCol, java.lang.Object newValue)
CollectionConstraint
true
iff the Collection formed by adding
newValue
to current
would be accepted
by this constraint.
validateAddValue
in interface CollectionConstraint
public boolean validateRemoveValue(java.util.Collection oldCol, java.lang.Object newValue)
CollectionConstraint
true
iff the Collection formed by removing
newValue
from current
would be accepted
by this constraint.
validateRemoveValue
in interface CollectionConstraint
public boolean subConstraintOf(CollectionConstraint cc)
CollectionConstraint
subConstraintOf
returns true if the constraint
is a sub-constraint.
A pair of constraints super and sub are in a superConstraint/subConstraint relationship if every object accepted by sub is also accepted by super. To put it another way, if instanceOf was used as a set-membership indicator function over some set of objects, then the set produced by super would be a superset of that produced by sub.
It is not expected that constraints will neccesarily
maintain references to super/sub types. It will be more usual
to infer this relationship by introspecting the constraints
themselves. For example,
CollectionConstraint.ByClass
will infer
subConstraintOf by looking at the possible class of all items
matching subConstraint.
subConstraintOf
in interface CollectionConstraint
cc
- a CollectionConstraint
to check.
boolean
.public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |