com.sas.services.information.search
Class DateFilter

com.sas.services.information.search.DateFilter
All Implemented Interfaces:
SearchFilter, java.io.Serializable

public class DateFilter
implements SearchFilter, java.io.Serializable

The DateFilter class is used to filter objects based on their metadata created or metadata modified date values.

See Also:
Serialized Form

Nested Class Summary
static class DateFilter.DateType
          The type of date to filter on
 
Constructor Summary
DateFilter(DateFilter.DateType type, java.util.Date beginDate)
          Constructs a new date filter that can filter on objects based on a since or begin date.
DateFilter(DateFilter.DateType type, java.util.Date beginDate, java.util.Date endDate)
          Constructs a new date filter that can filter on objects based on a date range (a range that has a begin and an end date)
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.Date getBeginDate()
          Returns the beginning date
 com.sas.util.DatePeriod getBeginDatePeriod()
          Returns the beginning (or since) date as an actual DatePeriod object.
 java.lang.String getDateRangeLabel()
          Gets the label of the range specified by the user.
 java.util.Date getEndDate()
          Returns the beginning date
 com.sas.util.DatePeriod getEndDatePeriod()
          Returns the ending (or before) date as an actual DatePeriod object.
 FilterComponent getFilterComponent()
          Returns the filter component used for processing this search criteria
 java.lang.String getFilterDescription()
          Returns the description of this filter.
 java.lang.String getFilterType()
          Returns the localized name of this filter.
 DateFilter.DateType getType()
          Returns the date type
 void setDateRangeLabel(java.lang.String rangeLabel)
          Sets the date range specified by the user.
 

Constructor Detail

DateFilter

public DateFilter(DateFilter.DateType type,
                  java.util.Date beginDate)
Constructs a new date filter that can filter on objects based on a since or begin date.

Parameters:
type - the date type
beginDate - the begin date to filter on

DateFilter

public DateFilter(DateFilter.DateType type,
                  java.util.Date beginDate,
                  java.util.Date endDate)
Constructs a new date filter that can filter on objects based on a date range (a range that has a begin and an end date)

Parameters:
type - the date type
beginDate - the begin date, or since date (inclusive)
endDate - the end date, or before date (exclusive)
Method Detail

getFilterType

public java.lang.String getFilterType()
Description copied from interface: SearchFilter
Returns the localized name of this filter. This method is typically used to help identify to the user what type of search is being performed. For instance, a name search, or a type search.

Specified by:
getFilterType in interface SearchFilter
Returns:
filter type

getFilterDescription

public java.lang.String getFilterDescription()
Description copied from interface: SearchFilter
Returns the description of this filter. This description is typically used for display purposes, or a log file, to inform the user what the intention of this filter is.

Specified by:
getFilterDescription in interface SearchFilter
Returns:
the filter description

setDateRangeLabel

public void setDateRangeLabel(java.lang.String rangeLabel)
Sets the date range specified by the user. This is only applicable when the user is filtering based on a date range, such as "year to date".

Parameters:
rangeLabel -

getDateRangeLabel

public java.lang.String getDateRangeLabel()
Gets the label of the range specified by the user. For example: "Year to date" or "Week to date". If the user never entered a range, and just manually entered to and from date values, this method will return null.

Returns:
range label, if available

getType

public DateFilter.DateType getType()
Returns the date type

Returns:
date type

getBeginDatePeriod

public com.sas.util.DatePeriod getBeginDatePeriod()
Returns the beginning (or since) date as an actual DatePeriod object.

Returns:
the beginning date as a DatePeriod

getBeginDate

public java.util.Date getBeginDate()
Returns the beginning date

Returns:
the beginning date

getEndDatePeriod

public com.sas.util.DatePeriod getEndDatePeriod()
Returns the ending (or before) date as an actual DatePeriod object.

Returns:
the ending date as a DatePeriod

getEndDate

public java.util.Date getEndDate()
Returns the beginning date

Returns:
the beginning date

getFilterComponent

public FilterComponent getFilterComponent()
Description copied from interface: SearchFilter
Returns the filter component used for processing this search criteria

Specified by:
getFilterComponent in interface SearchFilter
Returns:
filter component

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object



Copyright © 2009 SAS Institute Inc. All Rights Reserved.