Package writer2latex.xmerge
Class ConvertData
- java.lang.Object
-
- writer2latex.xmerge.ConvertData
-
- All Implemented Interfaces:
ConverterResult
public class ConvertData extends java.lang.Object implements ConverterResult
ConvertData
is used as a container for passingOutputFile
objects in and out of theConvert
class. TheConvertData
contains aString
name and aVector
ofOutputFile
objects.- Author:
- Martin Maher
-
-
Constructor Summary
Constructors Constructor Description ConvertData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDocument(OutputFile doc)
Adds aOutputFile
to the vector.OutputFile
getMasterDocument()
Get the master documentjava.lang.String
getName()
Returns theOutputFile
name.int
getNumDocuments()
Gets the number ofOutputFile
objects currently storedboolean
isMasterDocument(OutputFile doc)
Check if a given document is the master documentjava.util.Iterator
iterator()
Gets anIterator
to access theVector
ofOutputFile
objectsvoid
reset()
Resets ConvertData.void
setName(java.lang.String docName)
Sets theOutputFile
name.void
write(java.io.File dir)
Write all files of theConverterResult
to a directory.
-
-
-
Method Detail
-
reset
public void reset()
Resets ConvertData. This empties allOutputFile
objects from this class. This allows reuse of aConvertData
.
-
getName
public java.lang.String getName()
Returns theOutputFile
name.- Returns:
- The
OutputFile
name.
-
setName
public void setName(java.lang.String docName)
Sets theOutputFile
name.- Parameters:
docName
- The name of theOutputFile
.
-
addDocument
public void addDocument(OutputFile doc)
Adds aOutputFile
to the vector.- Parameters:
doc
- TheOutputFile
to add.
-
getMasterDocument
public OutputFile getMasterDocument()
Get the master document- Specified by:
getMasterDocument
in interfaceConverterResult
- Returns:
OutputFile
the master document
-
isMasterDocument
public boolean isMasterDocument(OutputFile doc)
Check if a given document is the master document- Parameters:
doc
- TheOutputFile
to check- Returns:
- true if this is the master document
-
iterator
public java.util.Iterator 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
public void write(java.io.File dir) throws java.io.IOException
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:
java.io.IOException
- if the directory does not exist or one or more files could not be written
-
-