org.jjoost.util.filters
Class AcceptLess<E extends java.lang.Comparable<? super E>>

java.lang.Object
  extended by org.jjoost.util.filters.PartialOrderAcceptLess<E>
      extended by org.jjoost.util.filters.AcceptLess<E>
All Implemented Interfaces:
java.io.Serializable, Filter<E>, FilterPartialOrder<E>, BothFilter<E>

public class AcceptLess<E extends java.lang.Comparable<? super E>>
extends PartialOrderAcceptLess<E>
implements BothFilter<E>

A partial order filter that accepts everything less than the provided value as determined by the Comparator provided to its methods by utilising classes.

This class implements both Filter and FilterPartialOrder; the Filter accept()method delegates to the object's compareTo() method, whereas the FilterPartialOrder methods utilise the provided comparator.

See Also:
Serialized Form

Constructor Summary
AcceptLess(E than)
          Constructs a new partial order filter that accepts everything less than the provided value as determined by the Comparator provided to its methods by utilising classes.
 
Method Summary
 boolean accept(E test)
          Returns true if the Filter accepts the parameter and false otherwise
static
<E extends java.lang.Comparable<? super E>>
AcceptLess<E>
get(E than)
          Returns a partial order filter that accepts everything less than the provided value as determined by the Comparator provided to its methods by utilising classes.
 java.lang.String toString()
           
 
Methods inherited from class org.jjoost.util.filters.PartialOrderAcceptLess
accept, mayAcceptBetween, mayRejectBetween
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jjoost.util.FilterPartialOrder
accept, mayAcceptBetween, mayRejectBetween
 

Constructor Detail

AcceptLess

public AcceptLess(E than)
Constructs a new partial order filter that accepts everything less than the provided value as determined by the Comparator provided to its methods by utilising classes.

Returns an object implementing both Filter and FilterPartialOrder; the Filter accept()method delegates to the object's compareTo() method, whereas the FilterPartialOrder methods utilise the provided comparators

Parameters:
than - exclusive upper limit of acceptable values
Method Detail

accept

public boolean accept(E test)
Description copied from interface: Filter
Returns true if the Filter accepts the parameter and false otherwise

Specified by:
accept in interface Filter<E extends java.lang.Comparable<? super E>>
Parameters:
test - value to test
Returns:
true if the filter accepts test; false otherwise

get

public static <E extends java.lang.Comparable<? super E>> AcceptLess<E> get(E than)
Returns a partial order filter that accepts everything less than the provided value as determined by the Comparator provided to its methods by utilising classes.

Returns an object implementing both Filter and FilterPartialOrder; the Filter accept()method delegates to the object's compareTo() method, whereas the FilterPartialOrder methods utilise the provided comparators

Parameters:
than - exclusive upper limit of acceptable values
Returns:
a filter that accepts everything less than the provided value

toString

public java.lang.String toString()
Overrides:
toString in class PartialOrderAcceptLess<E extends java.lang.Comparable<? super E>>