Class PEFBook

java.lang.Object
org.daisy.braille.pef.PEFBook
All Implemented Interfaces:
Serializable

public class PEFBook extends Object implements Serializable
Provides useful information about a PEF-document.
Author:
Joel HÃ¥kansson
See Also:
  • Method Details

    • load

      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

      public String 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

      public Iterable<String> 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

      public Iterable<String> getMetadata(String key)
      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

      public Iterable<String> getTitle()
      Gets the document title from this document's metadata. Convenience method for getMetadata("title")
    • getAuthors

      public Iterable<String> getAuthors()
      Gets the document authors from this document's metadata. Convenience method for getMetadata("creator")
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object