| net.sf.jga.fn.comparison.Between
Between | public class Between extends UnaryPredicate (Code) | | Unary Predicate that returns TRUE when its argument is between two given
values. By default, the range is inclusive: a constructor is provided that
allows client code to supply two predicates that can create exclusive ranges.
The comparison is performed using a comparator or a pair of functors supplied
at construction time: a default comparator will be used if the nested
Comparable class' default constructor is used.
The behaviour of this class in the presence of null arguments is left to the
implementation of the specific Comparator, however it is generally safe to
assume that using null arguments will cause a NullPointerException to be
thrown.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Inner Class :public static class Comparable extends Between | |
Constructor Summary | |
public | Between(T lo, T hi, Comparator<? super T> comp) Builds a Between predicate that returns TRUE when its argument is between
its two arguments (inclusive). | public | Between(UnaryFunctor<T, Boolean> lo, UnaryFunctor<T, Boolean> hi) Builds a Between predicate that returns TRUE when both of the given
predicates return TRUE for the same argument. |
serialVersionUID | final static long serialVersionUID(Code) | | |
Between | public Between(T lo, T hi, Comparator<? super T> comp)(Code) | | Builds a Between predicate that returns TRUE when its argument is between
its two arguments (inclusive). The given comparator will be used to
compare values.
throws: IllegalArgumentException - when either argument is null or whenlo > hi |
Between | public Between(UnaryFunctor<T, Boolean> lo, UnaryFunctor<T, Boolean> hi)(Code) | | Builds a Between predicate that returns TRUE when both of the given
predicates return TRUE for the same argument. This version of the
constructor is provided to allow finer control over the comparisons
performed.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(Between) method, if it
implements the nested Visitor interface.
|
fn | public Boolean fn(T x)(Code) | | Given argument x, returns TRUE if x is between lo and hi.
lo < x < hi |
|
|