jasi.sim.user.archive
Class XMLArchive

java.lang.Object
  extended by jasi.sim.basic.AbstractSimArchive
      extended by jasi.sim.user.archive.XMLArchive
Direct Known Subclasses:
AirtrafficArchive

public class XMLArchive
extends AbstractSimArchive

Simulation archive using the XML format.


Constructor Summary
XMLArchive()
           
 
Method Summary
 java.lang.String getExtension()
          Get the file extension of an archive.
 void prepareXMLEncoder(java.beans.XMLEncoder e)
          Set the persistence delegates of that XML encoder.
 void readElements()
          Read simulation elements from archive.
 void readEvents()
          Read simulation events from archive.
 void readFinish()
          Finish reading this archive from a file.
 void readInit(AbstractSimKernel sim, java.lang.String file)
          Initialization of reading this archive, when imported from a file.
 void readTables()
          Read condition tables from archive.
 java.lang.Object writeAndReadXML(java.lang.Object o)
          Write and read object in XML file.
 java.lang.Object writeAndReadXML(java.lang.Object o, java.lang.String file)
          Write and read object in XML file.
 void writeElements()
          Write simulation elements into archive.
 void writeEvents()
          Write simulation events into archive.
 void writeFinish()
          Write this archive to a file in XML format.
 void writeInit(AbstractSimKernel sim, java.lang.String file)
          Initialize this archive to export in a file in XML format.
 void writeTables()
          Write condition tables into archive.
 
Methods inherited from class jasi.sim.basic.AbstractSimArchive
read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLArchive

public XMLArchive()
Method Detail

writeInit

public void writeInit(AbstractSimKernel sim,
                      java.lang.String file)
Initialize this archive to export in a file in XML format.

Specified by:
writeInit in class AbstractSimArchive
Parameters:
sim - The simulation instance.
file - The file name.
See Also:
AbstractSimArchive.writeInit(jasi.sim.basic.AbstractSimKernel, java.lang.String)

readInit

public void readInit(AbstractSimKernel sim,
                     java.lang.String file)
Initialization of reading this archive, when imported from a file.

Specified by:
readInit in class AbstractSimArchive
Parameters:
sim - The simulation instance.
file - The file name.

writeTables

public void writeTables()
Write condition tables into archive.

Specified by:
writeTables in class AbstractSimArchive
See Also:
AbstractSimArchive.writeTables()

readTables

public void readTables()
Read condition tables from archive.

Specified by:
readTables in class AbstractSimArchive

writeElements

public void writeElements()
Write simulation elements into archive.

Specified by:
writeElements in class AbstractSimArchive
See Also:
AbstractSimArchive.writeElements()

readElements

public void readElements()
Read simulation elements from archive.

Specified by:
readElements in class AbstractSimArchive

writeEvents

public void writeEvents()
Write simulation events into archive.

Specified by:
writeEvents in class AbstractSimArchive
See Also:
AbstractSimArchive.writeEvents()

readEvents

public void readEvents()
Read simulation events from archive.

Specified by:
readEvents in class AbstractSimArchive

writeFinish

public void writeFinish()
Write this archive to a file in XML format.

Specified by:
writeFinish in class AbstractSimArchive
See Also:
AbstractSimArchive.writeFinish()

readFinish

public void readFinish()
Finish reading this archive from a file.

Specified by:
readFinish in class AbstractSimArchive

getExtension

public java.lang.String getExtension()
Get the file extension of an archive.

Specified by:
getExtension in class AbstractSimArchive
Returns:
The archive file's extension.

writeAndReadXML

public java.lang.Object writeAndReadXML(java.lang.Object o)
Write and read object in XML file.

Parameters:
o - The object to be written.
Returns:
The read object.

writeAndReadXML

public java.lang.Object writeAndReadXML(java.lang.Object o,
                                        java.lang.String file)
Write and read object in XML file.

Parameters:
o - The object to be written.
file - The XML file.
Returns:
The read object.

prepareXMLEncoder

public void prepareXMLEncoder(java.beans.XMLEncoder e)
Set the persistence delegates of that XML encoder.

Parameters:
e - The XML encoder.
See Also:
Using XMLEncoder