|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.PropertyConstraint.Enumeration
public static class PropertyConstraint.Enumeration
Enumeration
accepts a property if it is present
in the specified set of values.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.biojava.bio.PropertyConstraint |
---|
PropertyConstraint.And, PropertyConstraint.ByAnnotationType, PropertyConstraint.ByClass, PropertyConstraint.Enumeration, PropertyConstraint.ExactValue, PropertyConstraint.Or |
Field Summary |
---|
Fields inherited from interface org.biojava.bio.PropertyConstraint |
---|
ANY, NONE |
Constructor Summary | |
---|---|
PropertyConstraint.Enumeration(java.lang.Object[] values)
Creates a new Enumeration using the elements of the
specified array as a constraint. |
|
PropertyConstraint.Enumeration(java.util.Set values)
Creates a new Enumeration using the members of
the specified set as a constraint. |
Method Summary | |
---|---|
boolean |
accept(java.lang.Object value)
accept returns true if the value fulfills the
constraint. |
java.util.Set |
getValues()
getValues returns the set of values which
constrain the property. |
boolean |
subConstraintOf(PropertyConstraint subConstraint)
subConstraintOf returns true if the constraint
is a sub-constraint. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertyConstraint.Enumeration(java.util.Set values)
Enumeration
using the members of
the specified set as a constraint.
values
- a Set
of all possible valuespublic PropertyConstraint.Enumeration(java.lang.Object[] values)
Enumeration
using the elements of the
specified array as a constraint.
values
- an Array
of all possible valuesMethod Detail |
---|
public java.util.Set getValues()
getValues
returns the set of values which
constrain the property.
Set
.public boolean accept(java.lang.Object value)
PropertyConstraint
accept
returns true if the value fulfills the
constraint.
accept
in interface PropertyConstraint
value
- an Object
to check.
boolean
.public boolean subConstraintOf(PropertyConstraint subConstraint)
PropertyConstraint
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,
PropertyConstraint.ByClass
will infer
subConstraintOf by looking at the possible class of all items
matching subConstraint.
subConstraintOf
in interface PropertyConstraint
subConstraint
- a PropertyConstraint
to check.
boolean
.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |