Class LaTeXDocument
- java.lang.Object
-
- writer2latex.latex.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 LaTeXDocumentPortiongetContents()Returns theLaTeXDocumentPortion, that contains the contents of the document.java.lang.StringgetFileName()Returns theDocumentname with file extension.java.lang.StringgetName()Returns theDocumentname with no file extension.voidread(java.io.InputStream is)This method is supposed to readbytedata from the InputStream.voidsetEncoding(java.lang.String sEncoding)Set the output encoding to use when writing the document.voidwrite(java.io.OutputStream os)Writes out theDocumentcontent to the specifiedOutputStream.
-
-
-
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 theLaTeXDocument.nWrap- Lines should be wrapped after this position
-
-
Method Detail
-
read
public void read(java.io.InputStream is) throws java.io.IOExceptionThis method is supposed to read
bytedata from the InputStream. Currently it does nothing, since we don't need it.
-
getName
public java.lang.String getName()
Returns the
Documentname with no file extension.
-
getFileName
public java.lang.String getFileName()
Returns the
Documentname with file extension.- Specified by:
getFileNamein interfaceOutputFile- Returns:
- The
Documentname with file extension.
-
write
public void write(java.io.OutputStream os) throws java.io.IOExceptionWrites out the
Documentcontent to the specifiedOutputStream.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:
writein interfaceOutputFile- Parameters:
os-OutputStreamto write out theDocumentcontent.- 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.
-
-