Class PropertyConstraint.ExactValue
- All Implemented Interfaces:
PropertyConstraint
- Enclosing interface:
PropertyConstraint
Matches properties if they have exactly this one value.
This is like the extreme case of an Enumeration which has just one member. It is most usefull for selecting annotations with a particular property set to a particular value e.g. ID="01234".
If you want to declare that a property must have a single value In conjunction with CardinalityConstraint.ZERO_OR_ONE you could make a property that is potional but if present must have this value Use with FilterUtils.byAnnotation() to search for features with properties set to specific values- Author:
- Matthew Pocock
-
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
ConstructorsConstructorDescriptionExactValue
(Object value) Get a PropertyConstraint that matches this object and all those that are equal to it (by the Object.equals() method). -
Method Summary
-
Constructor Details
-
ExactValue
Get a PropertyConstraint that matches this object and all those that are equal to it (by the Object.equals() method).- Parameters:
value
- the Object to match against
-
-
Method Details
-
getValue
Get the value that all properties must match.- Returns:
- the value Object
-
accept
Description copied from interface:PropertyConstraint
accept
returns true if the value fulfills the constraint. Manually compare items with the PropertyConstraint. Node: this will ususaly be done for you in an AnnotationType instance Use for implementing accept() on AnnotatoinType- Specified by:
accept
in interfacePropertyConstraint
- Parameters:
obj
- anObject
to check.- Returns:
- a
boolean
.
-
subConstraintOf
Description copied from interface: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,
Useful when attempting to compare two constraints to see if it is necisary to retain both. You may want to check the more general or the more specific constraint only.PropertyConstraint.ByClass
will infer subConstraintOf by looking at the possible class of all items matching subConstraint.- Specified by:
subConstraintOf
in interfacePropertyConstraint
- Parameters:
pc
- aPropertyConstraint
to check.- Returns:
- a
boolean
.
-
toString
-