Package writer2latex.xmerge
Class ConvertData
java.lang.Object
writer2latex.xmerge.ConvertData
- All Implemented Interfaces:
ConverterResult
ConvertData is used as a container for passing
OutputFile objects in and out of the Convert
class. The ConvertData contains a String
name and a Vector of OutputFile objects.
- Author:
- Martin Maher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocument(OutputFile doc) Adds aOutputFileto the vector.Get the master documentgetName()Returns theOutputFilename.intGets the number ofOutputFileobjects currently storedbooleanCheck if a given document is the master documentiterator()Gets anIteratorto access theVectorofOutputFileobjectsvoidreset()Resets ConvertData.voidSets theOutputFilename.voidWrite all files of theConverterResultto a directory.
-
Constructor Details
-
ConvertData
public ConvertData()
-
-
Method Details
-
reset
public void reset()Resets ConvertData. This empties allOutputFileobjects from this class. This allows reuse of aConvertData. -
getName
Returns theOutputFilename.- Returns:
- The
OutputFilename.
-
setName
Sets theOutputFilename.- Parameters:
docName- The name of theOutputFile.
-
addDocument
Adds aOutputFileto the vector.- Parameters:
doc- TheOutputFileto add.
-
getMasterDocument
Get the master document- Specified by:
getMasterDocumentin interfaceConverterResult- Returns:
OutputFilethe master document
-
isMasterDocument
Check if a given document is the master document- Parameters:
doc- TheOutputFileto check- Returns:
- true if this is the master document
-
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
Description 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:
IOException- if the directory does not exist or one or more files could not be written
-