|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.bio.CollectionConstraint.Or
public static class CollectionConstraint.Or
A collection constraint that accepts items iff they are accepted by either child constraints. This effectively matches the union of the items matched by the two constraints.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface 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.Or(CollectionConstraint c1,
CollectionConstraint c2)
Create a new Or from two child constraints. |
|
| Method Summary | |
|---|---|
boolean |
accept(Object object)
accept returns true if the value fulfills the
constraint. |
CollectionConstraint |
getChild1()
Get the first child CollectionConstraint. |
CollectionConstraint |
getChild2()
Get the seccond child CollectionConstraint. |
boolean |
subConstraintOf(CollectionConstraint pc)
subConstraintOf returns true if the constraint
is a sub-constraint. |
String |
toString()
|
boolean |
validateAddValue(Collection oldcoll,
Object newvalue)
Return true iff the Collection formed by adding
newValue to current would be accepted
by this constraint. |
boolean |
validateRemoveValue(Collection oldcoll,
Object victim)
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionConstraint.Or(CollectionConstraint c1,
CollectionConstraint c2)
Or from two child constraints.
c1 - the first childc2 - the seccond child| Method Detail |
|---|
public CollectionConstraint getChild1()
public CollectionConstraint getChild2()
public boolean accept(Object object)
CollectionConstraintaccept returns true if the value fulfills the
constraint.
accept in interface CollectionConstraintobject - a Collection to check.
public boolean subConstraintOf(CollectionConstraint pc)
CollectionConstraintsubConstraintOf 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 CollectionConstraintpc - a CollectionConstraint to check.
boolean.
public boolean validateAddValue(Collection oldcoll,
Object newvalue)
CollectionConstrainttrue iff the Collection formed by adding
newValue to current would be accepted
by this constraint.
validateAddValue in interface CollectionConstraintoldcoll - a Collection containing the current valuesnewvalue - the new value to add
public boolean validateRemoveValue(Collection oldcoll,
Object victim)
CollectionConstrainttrue iff the Collection formed by removing
newValue from current would be accepted
by this constraint.
validateRemoveValue in interface CollectionConstraintoldcoll - a Collection containing the current valuesvictim - the value to remove
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||