eTextReader.AnnotationListing
Class PageSetNotationProvider

java.lang.Object
  extended by eTextReader.AnnotationListing.PageSetNotationProvider
All Implemented Interfaces:
NotationProvider

public class PageSetNotationProvider
extends java.lang.Object
implements NotationProvider

A NotationProvider that facilitates construction of a particular set of pages from which to draw annotations

Author:
mcfall

Field Summary
(package private)  java.util.Set<java.lang.String> pages
          The set of pages that will be included
 
Constructor Summary
PageSetNotationProvider()
          Constructs a PageSetNotationProvider with an initially empty set of pages
PageSetNotationProvider(java.util.Collection<java.lang.String> initialPages)
          Constructs a PageSetNotationProvider and configures the initial set of pages contained within it
 
Method Summary
 boolean addPage(java.lang.String page)
          Adds the specified page to the set of pages contained in this provider
 java.util.Set<java.lang.String> getCandidateURLs(java.lang.String userName)
          Determines a list of pages that contain may annotations for the specific user
 java.lang.String getDescription()
          Returns a description of this provider's scope.
 boolean remove(java.lang.String page)
          Removes the specified page from the set of pages contained in this provider
 void removeAll()
          Removes all pages from the set of pages contained in this provider
 boolean setPage(java.lang.String page)
          Makes it so that the specified page is the only page contained in this page set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pages

java.util.Set<java.lang.String> pages
The set of pages that will be included

Constructor Detail

PageSetNotationProvider

public PageSetNotationProvider()
Constructs a PageSetNotationProvider with an initially empty set of pages


PageSetNotationProvider

public PageSetNotationProvider(java.util.Collection<java.lang.String> initialPages)
Constructs a PageSetNotationProvider and configures the initial set of pages contained within it

Parameters:
initialPages - the pages to add to this collection
Method Detail

addPage

public boolean addPage(java.lang.String page)
Adds the specified page to the set of pages contained in this provider

Parameters:
page - the URL of the page to add
Returns:
true if the page was added, false if it already existed in the set

setPage

public boolean setPage(java.lang.String page)
Makes it so that the specified page is the only page contained in this page set

Parameters:
page - the page to be contained
Returns:
true if the page was added, false if it already existed

remove

public boolean remove(java.lang.String page)
Removes the specified page from the set of pages contained in this provider

Parameters:
page - the URL of the page to remove
Returns:
true if the page previously existed and was removed, false otherwise

removeAll

public void removeAll()
Removes all pages from the set of pages contained in this provider


getCandidateURLs

public java.util.Set<java.lang.String> getCandidateURLs(java.lang.String userName)
Description copied from interface: NotationProvider
Determines a list of pages that contain may annotations for the specific user

Specified by:
getCandidateURLs in interface NotationProvider
Parameters:
userName - the name of the user to check for annotations
Returns:
a (possibly empty) set containing String versions of URLs representing pages that contain annotations viewable by the specified user

getDescription

public java.lang.String getDescription()
Description copied from interface: NotationProvider
Returns a description of this provider's scope. Examples include Since this will usually be at the end of a phrase, the description should start with a lower case letter

Specified by:
getDescription in interface NotationProvider
Returns:
a string describing the provider's scope