Class LaTeXDocument

  • All Implemented Interfaces:
    OutputFile, Document

    public class LaTeXDocument
    extends java.lang.Object
    implements Document

    Class representing a LaTeX document.

    • Constructor Summary

      Constructors 
      Constructor Description
      LaTeXDocument​(java.lang.String sName, int nWrap)
      Constructs a new LaTeX Document.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LaTeXDocumentPortion getContents()
      Returns the LaTeXDocumentPortion, that contains the contents of the document.
      java.lang.String getFileName()
      Returns the Document name with file extension.
      java.lang.String getName()
      Returns the Document name with no file extension.
      void read​(java.io.InputStream is)
      This method is supposed to read byte data from the InputStream.
      void setEncoding​(java.lang.String sEncoding)
      Set the output encoding to use when writing the document.
      void write​(java.io.OutputStream os)
      Writes out the Document content to the specified OutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LaTeXDocument

        public LaTeXDocument​(java.lang.String sName,
                             int nWrap)

        Constructs a new LaTeX Document.

        This new document is empty. Document data must added to the preamble and the body using appropriate methods.

        Parameters:
        sName - The name of the LaTeXDocument.
        nWrap - Lines should be wrapped after this position
    • Method Detail

      • read

        public void read​(java.io.InputStream is)
                  throws java.io.IOException

        This method is supposed to read byte data from the InputStream. Currently it does nothing, since we don't need it.

        Specified by:
        read in interface Document
        Parameters:
        is - InputStream containing a LaTeX data file.
        Throws:
        java.io.IOException - In case of any I/O errors.
      • getName

        public java.lang.String getName()

        Returns the Document name with no file extension.

        Specified by:
        getName in interface Document
        Returns:
        The Document name with no file extension.
      • getFileName

        public java.lang.String getFileName()

        Returns the Document name with file extension.

        Specified by:
        getFileName in interface OutputFile
        Returns:
        The Document name with file extension.
      • write

        public void write​(java.io.OutputStream os)
                   throws java.io.IOException

        Writes out the Document content to the specified OutputStream.

        This method may not be thread-safe. Implementations may or may not synchronize this method. User code (i.e. caller) must make sure that calls to this method are thread-safe.

        Specified by:
        write in interface OutputFile
        Parameters:
        os - OutputStream to write out the Document content.
        Throws:
        java.io.IOException - If any I/O error occurs.
      • setEncoding

        public void setEncoding​(java.lang.String sEncoding)

        Set the output encoding to use when writing the document.

      • getContents

        public LaTeXDocumentPortion getContents()

        Returns the LaTeXDocumentPortion, that contains the contents of the document.

        Returns:
        The content LaTeXDocumentPortion.