JIDE 3.5.15

com.jidesoft.filter
Class BetweenFilter<T>

java.lang.Object
  extended by com.jidesoft.filter.AbstractFilter<T>
      extended by com.jidesoft.filter.BetweenFilter<T>
All Implemented Interfaces:
Filter<T>, ObjectGrouperSupport, SqlFilterSupport, Serializable, Cloneable
Direct Known Subclasses:
NotBetweenFilter

public class BetweenFilter<T>
extends AbstractFilter<T>
implements SqlFilterSupport

A Filter returns false in isValueFiltered(Object) only if the input value is between the two specified values. Please note, the value1 must be less than or equal to the second value.

See Also:
Serialized Form

Field Summary
protected  T _value1
           
protected  T _value2
           
 
Fields inherited from interface com.jidesoft.filter.Filter
ALL, CUSTOM, NULL, SEPARATOR
 
Constructor Summary
BetweenFilter()
           
BetweenFilter(String name, T value1, T value2)
           
BetweenFilter(T value1, T value2)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getOperator()
           
 String getPreference(Class<?> clazz, ConverterContext converterContext)
          Gets the preference while persisting this filter.
 T getValue1()
           
 T getValue2()
           
 boolean isValueFiltered(T value)
          Checks if the value is allowed.
 Object[] setPreference(String prefString, Class<?> clazz, ConverterContext converterContext)
          Sets the preference to load the preference string back to this filter.
 void setValue1(T value1)
           
 void setValue2(T value2)
           
 boolean stricterThan(Filter inputFilter)
          Check if this filter is stricter than the input filter while the two filters are with the same class.
 
Methods inherited from class com.jidesoft.filter.AbstractFilter
addFilterListener, clone, fireFilterChanged, fireFilterContentChanged, fireFilterDisabled, fireFilterEnabled, fireFilterNameChanged, getConditionString, getFilterFactory, getFilterFactoryName, getFilterListeners, getName, getObjectGrouper, getObjectGrouperName, isEnabled, isFilterValid, removeFilterListener, setEnabled, setFilterFactory, setFilterFactoryName, setName, setObjectGrouper, setObjectGrouperName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_value1

protected T _value1

_value2

protected T _value2
Constructor Detail

BetweenFilter

public BetweenFilter()

BetweenFilter

public BetweenFilter(T value1,
                     T value2)

BetweenFilter

public BetweenFilter(String name,
                     T value1,
                     T value2)
Method Detail

isValueFiltered

public boolean isValueFiltered(T value)
Checks if the value is allowed.

Specified by:
isValueFiltered in interface Filter<T>
Parameters:
value - the value to check.
Returns:
true if not allowed and false if allowed. Please note, this could be the opposite of what you thought as the method name is if the value is filtered.

getOperator

public String getOperator()
Specified by:
getOperator in interface SqlFilterSupport

getValue1

public T getValue1()

setValue1

public void setValue1(T value1)

getValue2

public T getValue2()

setValue2

public void setValue2(T value2)

stricterThan

public boolean stricterThan(Filter inputFilter)
Check if this filter is stricter than the input filter while the two filters are with the same class.

Specified by:
stricterThan in interface Filter<T>
Overrides:
stricterThan in class AbstractFilter<T>
Parameters:
inputFilter - the input filter
Returns:
true if the range of this filter is smaller than the input filter. Otherwise false.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getPreference

public String getPreference(Class<?> clazz,
                            ConverterContext converterContext)
Description copied from interface: Filter
Gets the preference while persisting this filter.

Specified by:
getPreference in interface Filter<T>
Overrides:
getPreference in class AbstractFilter<T>
Parameters:
clazz - the class type to convert the values inside the filter to string
converterContext - the converter context to convert the values inside the filter to string
Returns:
the preference string.

setPreference

public Object[] setPreference(String prefString,
                              Class<?> clazz,
                              ConverterContext converterContext)
Description copied from interface: Filter
Sets the preference to load the preference string back to this filter.

Specified by:
setPreference in interface Filter<T>
Overrides:
setPreference in class AbstractFilter<T>
Parameters:
prefString - the preference string
clazz - the class type to convert the values inside the filter to string
converterContext - the converter context to convert the values inside the filter to string
Returns:
the object array to be passed into the FilterFactoryManager if necessary.

JIDE 3.5.15