Package org.daisy.braille.pef
Class PEFBook
java.lang.Object
org.daisy.braille.pef.PEFBook
- All Implemented Interfaces:
Serializable
Provides useful information about a PEF-document.
- Author:
- Joel HÃ¥kansson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this document contains eight dot patterns, false otherwiseboolean
Gets the document authors from this document's metadata.int
getFirstPage
(int volume) Gets the first page number in the specified volumeGets the encoding used for this document at the time of the parsing.int
getLastPage
(int volume) Gets the last page number in the specified volumeint
Gets the maximum defined page height, in rowsint
Gets the maximum defined page width, in charsgetMetadata
(String key) Gets a collection of values for a specfied metadata key.Gets a collection of all metadata keys in this document.int
getPages()
Gets the total number of pages in this documentint
Gets the number of page tags in this document.int
Gets the number of sheets in this document.int
getSheets
(int volume) Gets the number of sheets in the specified volumegetTitle()
Gets the document title from this document's metadata.int
Gets the number of volumes in this document.int
hashCode()
static PEFBook
Loads information about a PEF-document from the supplied uri.toString()
-
Method Details
-
load
public static PEFBook load(URI uri) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException Loads information about a PEF-document from the supplied uri.- Parameters:
uri
- the uri to a PEF-document- Returns:
- returns a PEFBook object containing the information collected from the supplied PEF-document
- Throws:
ParserConfigurationException
SAXException
XPathExpressionException
IOException
-
getInputEncoding
Gets the encoding used for this document at the time of the parsing. -
getVolumes
public int getVolumes()Gets the number of volumes in this document. -
getPages
public int getPages()Gets the total number of pages in this document -
getPageTags
public int getPageTags()Gets the number of page tags in this document. -
getSheets
public int getSheets()Gets the number of sheets in this document. -
getSheets
public int getSheets(int volume) Gets the number of sheets in the specified volume- Parameters:
volume
- the desired volume, where the first volume is 1 and the last equals getVolumes- Returns:
- returns the number of sheets in the specified volume
- Throws:
IllegalArgumentException
- if the volume is less than 1 or greater than getVolumes
-
getFirstPage
public int getFirstPage(int volume) Gets the first page number in the specified volume- Parameters:
volume
- the desired volume, where the first volume is 1 and the last equals getVolumes.- Returns:
- returns the first page number in the specified volume
- Throws:
IllegalArgumentException
- if the volume is less than 1 or greater than getVolumes
-
getLastPage
public int getLastPage(int volume) Gets the last page number in the specified volume- Parameters:
volume
- the desired volume (the first volume is 1 and the last is getVolumes)- Returns:
- returns the last page number in the specified volume
- Throws:
IllegalArgumentException
- if the volume is less than 1 or greater than getVolumes
-
getMaxWidth
public int getMaxWidth()Gets the maximum defined page width, in chars -
getMaxHeight
public int getMaxHeight()Gets the maximum defined page height, in rows -
containsEightDot
public boolean containsEightDot()Returns true if this document contains eight dot patterns, false otherwise -
getMetadataKeys
Gets a collection of all metadata keys in this document. A metadata key is a local element name in the http://purl.org/dc/elements/1.1/ namespace. -
getMetadata
Gets a collection of values for a specfied metadata key. A metadata key is a local element name in the http://purl.org/dc/elements/1.1/ namespace.- Parameters:
key
- the metadata to get values for
-
getTitle
Gets the document title from this document's metadata. Convenience method for getMetadata("title") -
getAuthors
Gets the document authors from this document's metadata. Convenience method for getMetadata("creator") -
hashCode
public int hashCode() -
equals
-
toString
-