Package org.daisy.dotify.api.paper
Interface PaperCatalogService
-
- All Known Implementing Classes:
PaperCatalog
public interface PaperCatalogServiceProvides an interface for a PaperCatalog service. The purpose of this interface is to expose an implementation of a PaperCatalog as an OSGi service.
To comply with this interface, an implementation must be thread safe and address both the possibility that only a single instance is created and used throughout and that new instances are created as desired.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddNewRollPaper(String name, String desc, Length across)Adds a new roll paper to the collection.booleanaddNewSheetPaper(String name, String desc, Length width, Length height)Adds a new sheet paper to the collection.booleanaddNewTractorPaper(String name, String desc, Length across, Length along)Adds a new tractor paper to the collection.Paperget(String identifier)Gets a paper by identifier.booleanisRemovable(Paper paper)Returns true if the paper can be removed, false otherwiseCollection<Paper>list()Lists all available papers.Collection<Paper>list(PaperFilter filter)Lists available papers that the filter accepts.booleanremove(Paper p)Removes the specified paper from the collection.booleansupportsUserPapers()Returns true if user papers are supported, false otherwise.
-
-
-
Method Detail
-
get
Paper get(String identifier)
Gets a paper by identifier.- Parameters:
identifier- the identifier of the paper- Returns:
- returns the paper
-
list
Collection<Paper> list()
Lists all available papers.- Returns:
- returns a list of papers
-
list
Collection<Paper> list(PaperFilter filter)
Lists available papers that the filter accepts.- Parameters:
filter- the filter- Returns:
- returns a list of papers
-
supportsUserPapers
boolean supportsUserPapers()
Returns true if user papers are supported, false otherwise. If this method returns false,addNewSheetPaper(String, String, Length, Length),addNewRollPaper(String, String, Length),addNewTractorPaper(String, String, Length, Length),isRemovable(Paper),remove(Paper)should not be used.- Returns:
- true if user papers are supported, false otherwise
-
addNewSheetPaper
boolean addNewSheetPaper(String name, String desc, Length width, Length height)
Adds a new sheet paper to the collection.- Parameters:
name- the namedesc- the descriptionwidth- the widthheight- the height- Returns:
- true if the paper was added successfully, false otherwise
-
addNewTractorPaper
boolean addNewTractorPaper(String name, String desc, Length across, Length along)
Adds a new tractor paper to the collection.- Parameters:
name- the namedesc- the descriptionacross- the length across the feedalong- the length along the feed- Returns:
- true if the paper was added successfully, false otherwise
-
addNewRollPaper
boolean addNewRollPaper(String name, String desc, Length across)
Adds a new roll paper to the collection.- Parameters:
name- the namedesc- the descriptionacross- the length across the feed- Returns:
- true if the paper was added successfully, false otherwise
-
isRemovable
boolean isRemovable(Paper paper)
Returns true if the paper can be removed, false otherwise- Parameters:
paper- the paper- Returns:
- true if the paper can be removed, false otherwise
-
remove
boolean remove(Paper p)
Removes the specified paper from the collection.- Parameters:
p- the paper to remove- Returns:
- true if the paper was successfully removed, false otherwise
-
-