xml
Class XMLWriter

java.lang.Object
  extended by xml.XMLWriter

public class XMLWriter
extends java.lang.Object


Constructor Summary
XMLWriter()
          Empty constructor.
XMLWriter(java.lang.String path, MembranModel membranModel)
          New constructor.
 
Method Summary
 java.lang.String convertDoubleArrayToString(double[] array, java.lang.String separator)
          Converts an array of double values into a string.
 java.lang.String convertIntArrayToString(int[] array, java.lang.String separator)
          Converts an int array into a string.
 java.lang.String convertMatrix3fToString(javax.vecmath.Matrix3f matrix, java.lang.String separator)
          Converts a Matrix3f into a string.
 java.lang.String convertStringArrayToString(java.lang.String[] array, java.lang.String separator)
          Converts an array of strings into a single string.
 java.lang.String convertVectorIntArrayToString(java.util.Vector vector, java.lang.String separator)
          Converts a vector of int arrays into a string.
 org.jdom.Document createFile(java.lang.String filename, MembranModel membranModel)
          Parse the data of the MembranModel object and create an document.
 java.lang.String getPath()
           
 void setPath(java.lang.String string)
           
 void writeFile(org.jdom.Document doc, java.lang.String filename)
          Write the XML file with the XMLOutputter class.
 void writer_start(java.lang.String filename, MembranModel membranModel)
          Creates a new document using the createFile and writeFile functions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

public XMLWriter()
Empty constructor.


XMLWriter

public XMLWriter(java.lang.String path,
                 MembranModel membranModel)
New constructor.

Parameters:
path - Path where the XML file should be written
membranModel - MembranModel object
Method Detail

writer_start

public void writer_start(java.lang.String filename,
                         MembranModel membranModel)
Creates a new document using the createFile and writeFile functions.

Parameters:
filename - file name
membranModel - MembranModel object

createFile

public org.jdom.Document createFile(java.lang.String filename,
                                    MembranModel membranModel)
Parse the data of the MembranModel object and create an document.

Parameters:
filename - File name
Returns:
document Document which contains the MembranModel data

writeFile

public void writeFile(org.jdom.Document doc,
                      java.lang.String filename)
               throws java.io.IOException
Write the XML file with the XMLOutputter class.

Parameters:
doc - Document
filename - File name
Throws:
java.io.IOException

convertIntArrayToString

public java.lang.String convertIntArrayToString(int[] array,
                                                java.lang.String separator)
Converts an int array into a string.

Parameters:
array - Array of int values
separator - Separator for the values in the generated string
Returns:
String

convertMatrix3fToString

public java.lang.String convertMatrix3fToString(javax.vecmath.Matrix3f matrix,
                                                java.lang.String separator)
Converts a Matrix3f into a string.

Parameters:
matrix - Matrix3f
separator - Separator for the values in the generated string
Returns:
String

convertVectorIntArrayToString

public java.lang.String convertVectorIntArrayToString(java.util.Vector vector,
                                                      java.lang.String separator)
Converts a vector of int arrays into a string.

Parameters:
vector - Vector of int arrays of length 3.
separator - Separator for the values in the generated string
Returns:
String

convertDoubleArrayToString

public java.lang.String convertDoubleArrayToString(double[] array,
                                                   java.lang.String separator)
Converts an array of double values into a string.

Parameters:
array - Array of double values
separator - Separator for the values in the generated string
Returns:
String

convertStringArrayToString

public java.lang.String convertStringArrayToString(java.lang.String[] array,
                                                   java.lang.String separator)
Converts an array of strings into a single string.

Parameters:
array - Array of strings
separator - Separator for the values in the generated string
Returns:
String

getPath

public java.lang.String getPath()
Returns:
path String (Path of the file that should be written.)

setPath

public void setPath(java.lang.String string)
Parameters:
string - String that contains the path where the file should be written.