public interface Eligible
This interface provides a mechanism for matching objects, using a filter on the object’s “kind” as criterion. How the kind is represented depends completely on the class that implements this interface.
Every instance of a class that implement this interface must provide
a default criterion (filter) that accepts the instance (though, of course,
not only this particular instance). Formally: for every instance “obj
”
of Eligible
, the expression
obj.isEligibleFor(obj.getDefaultCrtiterion())
must return true
.
The default criterion can therefore be interpreted as the representation of the kind of the object.
Modifier and Type | Method and Description |
---|---|
Object |
defaultCriterion()
Returns a sample criterion that this
Eligible meets. |
boolean |
isEligibleFor(Object criterion)
Returns
true if this Eligible
is met by the provided criterion. |
boolean isEligibleFor(Object criterion)
Returns true
if this Eligible
is met by the provided criterion.
criterion
- the criteriontrue
if this meets the criterionObject defaultCriterion()
Returns a sample criterion that this Eligible
meets.