Package org.daisy.dotify.api.paper
Interface PaperCatalogService
-
- All Known Implementing Classes:
PaperCatalog
public interface PaperCatalogService
Provides 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 boolean
addNewRollPaper(String name, String desc, Length across)
Adds a new roll paper to the collection.boolean
addNewSheetPaper(String name, String desc, Length width, Length height)
Adds a new sheet paper to the collection.boolean
addNewTractorPaper(String name, String desc, Length across, Length along)
Adds a new tractor paper to the collection.Paper
get(String identifier)
Gets a paper by identifier.boolean
isRemovable(Paper paper)
Returns true if the paper can be removed, false otherwise.Collection<Paper>
list()
Lists all available papers.Collection<Paper>
list(PaperFilter filter)
Lists available papers that the filter accepts.boolean
remove(Paper p)
Removes the specified paper from the collection.boolean
supportsUserPapers()
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
-
-