|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.util.filters.AcceptEqual<E>
public class AcceptEqual<E>
A filter accepting only values equal to the one provided, using the provided definition of equality. The filter implements both
Filter and FilterPartialOrder.
| Constructor Summary | |
|---|---|
AcceptEqual(E than,
Equality<? super E> equality)
Constructs a new filter accepting only values equal to the one provided, using the provided definition of equality. |
|
| Method Summary | ||
|---|---|---|
boolean |
accept(E test)
Returns true if the Filter accepts the parameter and false otherwise |
|
boolean |
accept(E test,
java.util.Comparator<? super E> cmp)
Return true iff this filter and comparator combination accept the provided value |
|
static
|
get(E than)
Constructs a new filter accepting only values equal to the one provided, using default object equality. |
|
static
|
get(E than,
Equality<? super E> equality)
Constructs a new filter accepting only values equal to the one provided, using the provided definition of equality. |
|
boolean |
mayAcceptBetween(E lb,
boolean lbInclusive,
E ub,
boolean ubInclusive,
java.util.Comparator<? super E> cmp)
Returns true if there exists (in the total order defined by the comparator, not necessarily in any concrete data set this is being applied to) a value between lb and ub that this filter may accept. |
|
boolean |
mayRejectBetween(E lb,
boolean lbInclusive,
E ub,
boolean ubInclusive,
java.util.Comparator<? super E> cmp)
Returns true if there exists (in the total order defined by the comparator, not necessarily in any concrete data set this is being applied to) a value between lb and ub that this filter may reject. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AcceptEqual(E than,
Equality<? super E> equality)
Filter and FilterPartialOrder.
than - value to acceptequality - the definition of equality| Method Detail |
|---|
public boolean accept(E test)
Filtertrue if the Filter accepts the parameter and false otherwise
accept in interface Filter<E>test - value to test
true if the filter accepts test; false otherwise
public boolean accept(E test,
java.util.Comparator<? super E> cmp)
FilterPartialOrder
accept in interface FilterPartialOrder<E>test - the value to checkcmp - the partial order
public boolean mayAcceptBetween(E lb,
boolean lbInclusive,
E ub,
boolean ubInclusive,
java.util.Comparator<? super E> cmp)
FilterPartialOrderlb and ub that this filter may accept.
This method may return true if there is no such value, at the cost of more expensive execution but valid behaviour,
however it cannot return false if there is such a value without breaking functionality.
null values should be seen as both +/- infinity, i.e.
containsBetween(null, o) should return containsBefore(o) and
containsBetween(o, null) should return containsAfter(o)
containsBetween should take arguments IN ORDER, i.e. o1 <= o2;
behaviour where o2 < o1 is undefined.
mayAcceptBetween in interface FilterPartialOrder<E>lb - the lower bound of the range to checklbInclusive - if the lower bound should be taken as inclusiveub - the upper bound of the range to checkubInclusive - if the upper bound should be taken as inclusivecmp - the partial order
public boolean mayRejectBetween(E lb,
boolean lbInclusive,
E ub,
boolean ubInclusive,
java.util.Comparator<? super E> cmp)
FilterPartialOrderlb and ub that this filter may reject.
This method may return true if there is no such value at the cost of more expensive execution but valid behaviour,
however it cannot return false if there is such a value without breaking functionality.
null values should be seen as both +/- infinity, i.e.
containsBetween(null, o) should return containsBefore(o) and
containsBetween(o, null) should return containsAfter(o)
containsBetween should take arguments IN ORDER, i.e. o1 <= o2;
behaviour where o2 < o1 is undefined.
mayRejectBetween in interface FilterPartialOrder<E>lb - the lower bound of the range to checklbInclusive - if the lower bound should be taken as inclusiveub - the upper bound of the range to checkubInclusive - if the upper bound should be taken as inclusivecmp - the partial order
public static <E> AcceptEqual<E> get(E than)
Filter and FilterPartialOrder.
than - value to accept
public static <E> AcceptEqual<E> get(E than,
Equality<? super E> equality)
Filter and FilterPartialOrder.
than - value to acceptequality - the definition of equalitypublic 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 | |||||||||