eTextReader.AnnotationListing
Class CompoundFilter

java.lang.Object
  extended by eTextReader.AnnotationListing.CompoundFilter
All Implemented Interfaces:
NotationFilter
Direct Known Subclasses:
RangeFilter

public class CompoundFilter
extends java.lang.Object
implements NotationFilter

Provides an implementation of the NotationFilter interface that allows joining together of two other NotationFilters. The two filters can be combined using either a union or intersection operation, depending on the CombinationMode specified when the CompoundFilter is constructed

Author:
mcfall
See Also:
CombinationMode

Field Summary
private  NotationFilter filter1
           
private  NotationFilter filter2
           
private  CombinationMode mode
           
 
Constructor Summary
CompoundFilter()
           
CompoundFilter(CombinationMode mode)
           
CompoundFilter(NotationFilter filter1, NotationFilter filter2, CombinationMode mode)
           
 
Method Summary
 java.lang.String getDescription()
          Retrieves a description of this filter, used to display information about this filter in a menu item, button, etc.
 java.lang.String getEndDate()
          Retrieves the ending date for notations that match this filter.
 NotationFilter getFilter1()
           
 NotationFilter getFilter2()
           
 CombinationMode getMode()
           
 java.lang.String getStartDate()
          Retrieves the starting date for notations that match this filter.
 boolean include(Notation n)
          Determines whether the notation n matches the criteria for inclusion provided by this filter
 boolean isDateFilter()
          Determines whether this filter includes a date component; used to restrict the annotations returned by requestViewableAnnotations
 void setFilter1(NotationFilter filter1)
           
 void setFilter2(NotationFilter filter2)
           
 void setMode(CombinationMode mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mode

private CombinationMode mode

filter1

private NotationFilter filter1

filter2

private NotationFilter filter2
Constructor Detail

CompoundFilter

public CompoundFilter()

CompoundFilter

public CompoundFilter(CombinationMode mode)

CompoundFilter

public CompoundFilter(NotationFilter filter1,
                      NotationFilter filter2,
                      CombinationMode mode)
Method Detail

getEndDate

public java.lang.String getEndDate()
Description copied from interface: NotationFilter
Retrieves the ending date for notations that match this filter. If isDateFilter returns false, this method must return null

Specified by:
getEndDate in interface NotationFilter
Returns:
the ending date associated with the filter, or null if not applicable

getStartDate

public java.lang.String getStartDate()
Description copied from interface: NotationFilter
Retrieves the starting date for notations that match this filter. If getStartDate in interface NotationFilter
Returns:
the starting date associated with the filter, or null if not applicable

include

public boolean include(Notation n)
Description copied from interface: NotationFilter
Determines whether the notation n matches the criteria for inclusion provided by this filter

Specified by:
include in interface NotationFilter
Parameters:
n - the notation to filter
Returns:

isDateFilter

public boolean isDateFilter()
Description copied from interface: NotationFilter
Determines whether this filter includes a date component; used to restrict the annotations returned by requestViewableAnnotations

Specified by:
isDateFilter in interface NotationFilter
Returns:
true if this filter includes a date range component, false otherwise

getFilter1

public NotationFilter getFilter1()

setFilter1

public void setFilter1(NotationFilter filter1)

getFilter2

public NotationFilter getFilter2()

setFilter2

public void setFilter2(NotationFilter filter2)

getMode

public CombinationMode getMode()

setMode

public void setMode(CombinationMode mode)

getDescription

public java.lang.String getDescription()
Description copied from interface: NotationFilter
Retrieves a description of this filter, used to display information about this filter in a menu item, button, etc. Examples would be etc.

Specified by:
getDescription in interface NotationFilter
Returns:
a String description of this filter