eTextReader.AnnotationListing
Class AnnotationTypeFilter

java.lang.Object
  extended by eTextReader.AnnotationListing.AnnotationTypeFilter
All Implemented Interfaces:
NotationFilter

public class AnnotationTypeFilter
extends java.lang.Object
implements NotationFilter

A filter that only accepts a certain type of annotation

Author:
mcfall
See Also:
Notation.AnnotationType

Field Summary
private  Notation.AnnotationType type
          The type of annotation this filter accepts
 
Constructor Summary
AnnotationTypeFilter(Notation.AnnotationType type)
          Constructs a new AnnotationTypeFilter that accepts the given type of annotation
 
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.
 java.lang.String getStartDate()
          Retrieves the starting date for notations that match this filter.
 java.lang.String getType()
           
 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 setType(Notation.AnnotationType annotationType)
          Changes the type of annotation that this filter responds to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private Notation.AnnotationType type
The type of annotation this filter accepts

Constructor Detail

AnnotationTypeFilter

public AnnotationTypeFilter(Notation.AnnotationType type)
Constructs a new AnnotationTypeFilter that accepts the given type of annotation

Parameters:
type - the type of annotation to accept
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

setType

public void setType(Notation.AnnotationType annotationType)
Changes the type of annotation that this filter responds to

Parameters:
annotationType -

getType

public java.lang.String getType()
Returns:

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