com.endeca.portal.data.functions
Class DateRangeFilter

java.lang.Object
  extended by com.endeca.portal.data.functions.QueryFunction
      extended by com.endeca.portal.data.functions.QueryFilter
          extended by com.endeca.portal.data.functions.RangeFilter
              extended by com.endeca.portal.data.functions.DateRangeFilter
All Implemented Interfaces:
SingleAttributeFilter, java.io.Serializable, java.lang.Cloneable

public class DateRangeFilter
extends RangeFilter

Inherit RangeFilter class to store the selection level and format style info into data source.

Author:
Endeca Technologies, Inc.
See Also:
Serialized Form

Nested Class Summary
static class DateRangeFilter.SelectionLevel
          Specifies the type of RangeFilter
 
Nested classes/interfaces inherited from class com.endeca.portal.data.functions.RangeFilter
RangeFilter.RangeFilterCreationException, RangeFilter.RangeOperator, RangeFilter.RangeOperatorNotSupportedException, RangeFilter.RangeType, RangeFilter.RangeTypeNotSupportedException
 
Field Summary
 
Fields inherited from class com.endeca.portal.data.functions.QueryFilter
filterId
 
Fields inherited from class com.endeca.portal.data.functions.QueryFunction
CLASS_PROPERTY, VIEWKEY_PROPERTY
 
Constructor Summary
protected DateRangeFilter()
           
 
Method Summary
 void beforeQueryStateAdd(QueryState state)
          Function to check for any additional conditions when adding to the query state.
static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey, RangeFilter.RangeOperator rangeOperator, java.util.Date lowerBound, java.util.Date upperBound, DateRangeFilter.SelectionLevel selectionLevel)
          Constructs a DateRangeFilter for filtering between a min and max date.
static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey, RangeFilter.RangeOperator rangeOperator, java.util.Date lowerBound, java.util.Date upperBound, DateRangeFilter.SelectionLevel selectionLevel, boolean isMultiAssign)
          Constructs a DateRangeFilter for multi-assign attributes to filtering between a min and max date.
static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey, RangeFilter.RangeOperator rangeOperator, java.util.Date bound, DateRangeFilter.SelectionLevel selectionLevel)
          Constructs a DateRangeFilter
static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey, RangeFilter.RangeOperator rangeOperator, java.util.Date bound, DateRangeFilter.SelectionLevel selectionLevel, boolean isMultiAssign)
          Constructs a DateRangeFilter for multi-assign attributes
 DateRangeFilter.SelectionLevel getSelectionLevel()
           
 void setSelectionLevel(DateRangeFilter.SelectionLevel selectionLevel)
           
 java.lang.String toString()
          Creates a string representation of the DateRangeFilter by appending location name to a string representation of the RangeFilter.
 
Methods inherited from class com.endeca.portal.data.functions.RangeFilter
applyToDiscoveryServiceQuery, getAttributeKey, getCompareString, getMultiAssign, getProperty, getRangeOperator, getRangeType, getValue1, getValue2, getValue3, passesSelectiveFilter, setAttributeKey, setMultiAssign, setProperty, setRangeOperator, setRangeType, setValue1, setValue2, setValue3
 
Methods inherited from class com.endeca.portal.data.functions.QueryFilter
getFilterId, isBaseFilter, setBaseFilter
 
Methods inherited from class com.endeca.portal.data.functions.QueryFunction
beforeQueryStateRemove, clone, equals, equals, getName, getVersion, getViewKey, hashCode, initializeFromJSON, setName, setVersion, setViewKey, substituteAttributeKeys, upgrade
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateRangeFilter

protected DateRangeFilter()
Method Detail

getSelectionLevel

public DateRangeFilter.SelectionLevel getSelectionLevel()
Returns:
the selectionLevel

setSelectionLevel

public void setSelectionLevel(DateRangeFilter.SelectionLevel selectionLevel)
Parameters:
selectionLevel - the selectionLevel to set

beforeQueryStateAdd

public void beforeQueryStateAdd(QueryState state)
Description copied from class: QueryFunction
Function to check for any additional conditions when adding to the query state. The base function won't do anything, but can be overridden as necessary.

Overrides:
beforeQueryStateAdd in class RangeFilter

createDateRangeFilter

public static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey,
                                                    RangeFilter.RangeOperator rangeOperator,
                                                    java.util.Date lowerBound,
                                                    java.util.Date upperBound,
                                                    DateRangeFilter.SelectionLevel selectionLevel)
                                             throws RangeFilter.RangeFilterCreationException
Constructs a DateRangeFilter for filtering between a min and max date.

Parameters:
attributeKey -
rangeOperator - should be BETWEEN
lowerBound - min date
upperBound - max date
selectionLevel - granularity of the date range (i.e. DAY, MONTH, or YEAR)
Throws:
RangeFilterCreationException
RangeFilter.RangeFilterCreationException

createDateRangeFilter

public static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey,
                                                    RangeFilter.RangeOperator rangeOperator,
                                                    java.util.Date lowerBound,
                                                    java.util.Date upperBound,
                                                    DateRangeFilter.SelectionLevel selectionLevel,
                                                    boolean isMultiAssign)
                                             throws RangeFilter.RangeFilterCreationException
Constructs a DateRangeFilter for multi-assign attributes to filtering between a min and max date.

Parameters:
attributeKey -
rangeOperator - should be BETWEEN
lowerBound - min date
upperBound - max date
selectionLevel - granularity of the date range (i.e. DAY, MONTH, or YEAR)
isMultiAssign - is the multi-assign attribute
Throws:
RangeFilterCreationException
RangeFilter.RangeFilterCreationException

createDateRangeFilter

public static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey,
                                                    RangeFilter.RangeOperator rangeOperator,
                                                    java.util.Date bound,
                                                    DateRangeFilter.SelectionLevel selectionLevel)
                                             throws RangeFilter.RangeFilterCreationException
Constructs a DateRangeFilter

Parameters:
attributeKey -
rangeOperator -
bound -
selectionLevel -
Throws:
RangeFilterCreationException
RangeFilter.RangeFilterCreationException

createDateRangeFilter

public static DateRangeFilter createDateRangeFilter(java.lang.String attributeKey,
                                                    RangeFilter.RangeOperator rangeOperator,
                                                    java.util.Date bound,
                                                    DateRangeFilter.SelectionLevel selectionLevel,
                                                    boolean isMultiAssign)
                                             throws RangeFilter.RangeFilterCreationException
Constructs a DateRangeFilter for multi-assign attributes

Parameters:
attributeKey -
rangeOperator -
bound -
selectionLevel -
isMultiAssign - is the multi-assign attribute
Throws:
RangeFilterCreationException
RangeFilter.RangeFilterCreationException

toString

public java.lang.String toString()
Creates a string representation of the DateRangeFilter by appending location name to a string representation of the RangeFilter. By doing this, two GeoFilter with different locationName will never be considered equal.

Overrides:
toString in class RangeFilter