org.jcreme.filters
Class IntervalFilter

java.lang.Object
  extended byorg.jcreme.filters.IntervalFilter
All Implemented Interfaces:
java.lang.Cloneable, Filter, java.io.Serializable
Direct Known Subclasses:
DateIntervalFilter, DoubleIntervalFilter

public class IntervalFilter
extends java.lang.Object
implements Filter, java.io.Serializable, java.lang.Cloneable

This filter enables to perform an AND between two OrderFilters. Therefore it models an interval of values. This class should be overriden to provide a stronger typing. No accessor methods are provided here so that the implementing classes can provide a typed method.

Version:
$Revision: 1.3 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
static java.lang.String LOWER_FILTER_PROPERTY
          The property that is used to signal changes of the lower filter.
(package private) static long serialVersionUID
           
static java.lang.String UPPER_FILTER_PROPERTY
          The property that is used to signal changes of the upper filter.
 
Constructor Summary
IntervalFilter(OrderFilter lowerFilter, OrderFilter upperFilter)
          Creates a new instance of IntervalFilter
 
Method Summary
 boolean accept(java.lang.Object obj)
          This is the actual filtering method.
 java.lang.Object clone()
          This forces override of the Object class clone method. it makes a deep copy so a change in a subfilter does not affect the cloned version.
 boolean equals(java.lang.Object o)
           
protected  OrderFilter getLowerFilterInternal()
           
protected  OrderFilter getUpperFilterInternal()
           
 int hashCode()
           
protected  void setLowerFilter(OrderFilter filter)
           
protected  void setUpperFilter(OrderFilter filter)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

LOWER_FILTER_PROPERTY

public static final java.lang.String LOWER_FILTER_PROPERTY
The property that is used to signal changes of the lower filter.

See Also:
Constant Field Values

UPPER_FILTER_PROPERTY

public static final java.lang.String UPPER_FILTER_PROPERTY
The property that is used to signal changes of the upper filter.

See Also:
Constant Field Values
Constructor Detail

IntervalFilter

public IntervalFilter(OrderFilter lowerFilter,
                      OrderFilter upperFilter)
Creates a new instance of IntervalFilter

Parameters:
lowerFilter - the lower filter for the interval.
upperFilter - the upper filter for the interval.
Method Detail

setLowerFilter

protected void setLowerFilter(OrderFilter filter)
Parameters:
filter - a filter to restrict the current interval.

getLowerFilterInternal

protected OrderFilter getLowerFilterInternal()
Returns:
the lower filter of the interval.

setUpperFilter

protected void setUpperFilter(OrderFilter filter)
Parameters:
filter - a filter to restrict the current interval.

getUpperFilterInternal

protected OrderFilter getUpperFilterInternal()
Returns:
the upper filter of the interval.

accept

public boolean accept(java.lang.Object obj)
This is the actual filtering method.

Specified by:
accept in interface Filter
Parameters:
obj - the Object to filter.
Returns:
true if the given object satisfies all the conditions of the filter.

toString

public java.lang.String toString()
See Also:
Object.toString()

hashCode

public int hashCode()
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object o)
See Also:
Object.equals(java.lang.Object)

clone

public java.lang.Object clone()
Description copied from interface: Filter
This forces override of the Object class clone method. it makes a deep copy so a change in a subfilter does not affect the cloned version.

Specified by:
clone in interface Filter
See Also:
Object.clone()


Copyright 2006 null. All Rights Reserved.