|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.util.filters.PartialOrderOverride<S,T>
public class PartialOrderOverride<S,T>
Constructs a FilterPartialOrder which delegates to the provided filter, but ignores the comparator provided to it, always
using the one provided here instead. That is, this forces the comparator used by the provided filter to always be the one provided
here. It also transforms the type of the FilterPartialOrder by accepting a method from a new type to the type accepted by the provided
filter, thereby providing a filter over the domain type of the function. The function should be stable with regards to the comparator,
i.e. a < b <==> f.f(a) < f.f(b)
| Constructor Summary | |
|---|---|
PartialOrderOverride(FilterPartialOrder<S> underlying,
java.util.Comparator<? super S> cmp,
Function<? super T,? extends S> f)
Constructs a FilterPartialOrder which delegates to the provided filter, but ignores the comparator provided to it, always
using the one provided here instead. |
|
| Method Summary | ||
|---|---|---|
boolean |
accept(T test,
java.util.Comparator<? super T> _)
Return true iff this filter and comparator combination accept the provided value |
|
static
|
get(FilterPartialOrder<S> filter,
java.util.Comparator<? super S> cmp,
Function<? super T,? extends S> f)
Returns a FilterPartialOrder which delegates to the provided filter, but ignores the comparator provided to it, always
using the one provided here instead. |
|
boolean |
mayAcceptBetween(T lb,
boolean lbInclusive,
T ub,
boolean ubInclusive,
java.util.Comparator<? super T> _)
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(T lb,
boolean lbInclusive,
T ub,
boolean ubInclusive,
java.util.Comparator<? super T> _)
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. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PartialOrderOverride(FilterPartialOrder<S> underlying,
java.util.Comparator<? super S> cmp,
Function<? super T,? extends S> f)
FilterPartialOrder which delegates to the provided filter, but ignores the comparator provided to it, always
using the one provided here instead. That is, this forces the comparator used by the provided filter to always be the one provided
here. It also transforms the type of the FilterPartialOrder by accepting a method from a new type to the type accepted by the provided
filter, thereby providing a filter over the domain type of the function. The function should be stable with regards to the comparator,
i.e. a < b <==> f.f(a) < f.f(b)
underlying - the partial order filter to wrapcmp - the comparator to pass to its accepts() methods, overriding the one provided by utilising classesf - a function whose range is the input type of the provided filter, and whose domain will be the input type of the filter returned| Method Detail |
|---|
public boolean mayAcceptBetween(T lb,
boolean lbInclusive,
T ub,
boolean ubInclusive,
java.util.Comparator<? super T> _)
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<T>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 inclusive_ - the partial order
public boolean mayRejectBetween(T lb,
boolean lbInclusive,
T ub,
boolean ubInclusive,
java.util.Comparator<? super T> _)
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<T>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 inclusive_ - the partial order
public boolean accept(T test,
java.util.Comparator<? super T> _)
FilterPartialOrder
accept in interface FilterPartialOrder<T>test - the value to check_ - the partial order
public static <S,T> PartialOrderOverride<S,T> get(FilterPartialOrder<S> filter,
java.util.Comparator<? super S> cmp,
Function<? super T,? extends S> f)
FilterPartialOrder which delegates to the provided filter, but ignores the comparator provided to it, always
using the one provided here instead. That is, this forces the comparator used by the provided filter to always be the one provided
here. It also transforms the type of the FilterPartialOrder by accepting a method from a new type to the type accepted by the provided
filter, thereby providing a filter over the domain type of the function. The function should be stable with regards to the comparator,
i.e. a < b <==> f.f(a) < f.f(b)
filter - the partial order filter to wrapcmp - the comparator to pass to its accepts() methods, overriding the one provided by utilising classesf - a function whose range is the input type of the provided filter, and whose domain will be the input type of the filter returned
FilterPartialOrder which always uses the provided comparator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||