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 TypeMethodDescriptionbooleanReturns true if this document contains eight dot patterns, false otherwisebooleanGets the document authors from this document's metadata.intgetFirstPage(int volume) Gets the first page number in the specified volumeGets the encoding used for this document at the time of the parsing.intgetLastPage(int volume) Gets the last page number in the specified volumeintGets the maximum defined page height, in rowsintGets 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.intgetPages()Gets the total number of pages in this documentintGets the number of page tags in this document.intGets the number of sheets in this document.intgetSheets(int volume) Gets the number of sheets in the specified volumegetTitle()Gets the document title from this document's metadata.intGets the number of volumes in this document.inthashCode()static PEFBookLoads 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:
ParserConfigurationExceptionSAXExceptionXPathExpressionExceptionIOException
-
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
-