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 TypeMethodDescriptionvoid
addDocument
(OutputFile doc) Adds aOutputFile
to the vector.Get the master documentgetName()
Returns theOutputFile
name.int
Gets the number ofOutputFile
objects currently storedboolean
Check if a given document is the master documentiterator()
Gets anIterator
to access theVector
ofOutputFile
objectsvoid
reset()
Resets ConvertData.void
Sets theOutputFile
name.void
Write all files of theConverterResult
to a directory.
-
Constructor Details
-
ConvertData
public ConvertData()
-
-
Method Details
-
reset
public void reset()Resets ConvertData. This empties allOutputFile
objects from this class. This allows reuse of aConvertData
. -
getName
Returns theOutputFile
name.- Returns:
- The
OutputFile
name.
-
setName
Sets theOutputFile
name.- Parameters:
docName
- The name of theOutputFile
.
-
addDocument
Adds aOutputFile
to the vector.- Parameters:
doc
- TheOutputFile
to add.
-
getMasterDocument
Get the master document- Specified by:
getMasterDocument
in interfaceConverterResult
- Returns:
OutputFile
the master document
-
isMasterDocument
Check if a given document is the master document- Parameters:
doc
- TheOutputFile
to check- Returns:
- true if this is the master document
-
iterator
Gets anIterator
to access theVector
ofOutputFile
objects- Specified by:
iterator
in interfaceConverterResult
- Returns:
- The
Iterator
to access theVector
ofOutputFile
objects.
-
getNumDocuments
public int getNumDocuments()Gets the number ofOutputFile
objects currently stored- Returns:
- The number of
OutputFile
objects currently stored.
-
write
Description copied from interface:ConverterResult
Write all files of theConverterResult
to a directory. Subdirectories are created as required by the individualOutputFile
s.- Specified by:
write
in 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
-