Package writer2latex.xmerge
Class ConvertData
- java.lang.Object
-
- writer2latex.xmerge.ConvertData
-
- All Implemented Interfaces:
ConverterResult
public class ConvertData extends java.lang.Object implements ConverterResult
ConvertDatais used as a container for passingOutputFileobjects in and out of theConvertclass. TheConvertDatacontains aStringname and aVectorofOutputFileobjects.- Author:
- Martin Maher
-
-
Constructor Summary
Constructors Constructor Description ConvertData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDocument(OutputFile doc)Adds aOutputFileto the vector.OutputFilegetMasterDocument()Get the master documentjava.lang.StringgetName()Returns theOutputFilename.intgetNumDocuments()Gets the number ofOutputFileobjects currently storedbooleanisMasterDocument(OutputFile doc)Check if a given document is the master documentjava.util.Iteratoriterator()Gets anIteratorto access theVectorofOutputFileobjectsvoidreset()Resets ConvertData.voidsetName(java.lang.String docName)Sets theOutputFilename.voidwrite(java.io.File dir)Write all files of theConverterResultto a directory.
-
-
-
Method Detail
-
reset
public void reset()
Resets ConvertData. This empties allOutputFileobjects from this class. This allows reuse of aConvertData.
-
getName
public java.lang.String getName()
Returns theOutputFilename.- Returns:
- The
OutputFilename.
-
setName
public void setName(java.lang.String docName)
Sets theOutputFilename.- Parameters:
docName- The name of theOutputFile.
-
addDocument
public void addDocument(OutputFile doc)
Adds aOutputFileto the vector.- Parameters:
doc- TheOutputFileto add.
-
getMasterDocument
public OutputFile getMasterDocument()
Get the master document- Specified by:
getMasterDocumentin interfaceConverterResult- Returns:
OutputFilethe master document
-
isMasterDocument
public boolean isMasterDocument(OutputFile doc)
Check if a given document is the master document- Parameters:
doc- TheOutputFileto check- Returns:
- true if this is the master document
-
iterator
public java.util.Iterator iterator()
Gets anIteratorto access theVectorofOutputFileobjects- Specified by:
iteratorin interfaceConverterResult- Returns:
- The
Iteratorto access theVectorofOutputFileobjects.
-
getNumDocuments
public int getNumDocuments()
Gets the number ofOutputFileobjects currently stored- Returns:
- The number of
OutputFileobjects currently stored.
-
write
public void write(java.io.File dir) throws java.io.IOExceptionDescription copied from interface:ConverterResultWrite all files of theConverterResultto a directory. Subdirectories are created as required by the individualOutputFiles.- Specified by:
writein interfaceConverterResult- Parameters:
dir- the directory to write to (this directory must exist). If the parameter is null, the default directory is used- Throws:
java.io.IOException- if the directory does not exist or one or more files could not be written
-
-