mascoptDev.io.graph
Class MGXTubeWriter

java.lang.Object
  |
  +--mascoptLib.io.graph.MGLWriter
        |
        +--mascoptLib.io.graph.MGXWriter
              |
              +--mascoptDev.io.graph.MGXTubeWriter
All Implemented Interfaces:
WriterInterface

public class MGXTubeWriter
extends MGXWriter
implements WriterInterface

XML Writer for tubes

This is a derivated class from MGXWriter which writes tubes (Smita tubes) in a file.

Version:
Thur Jun 27 2002
Author:
srai@sophia.inria.fr

Constructor Summary
MGXTubeWriter(OutputStream os)
          Constructs a writer on a stream.
MGXTubeWriter(String file)
          Constructs a writer on a file.
 
Method Summary
 void add(Object object)
          Add an object to write in the file.
 void write()
          Write the file with all objects added in the Writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MGXTubeWriter

public MGXTubeWriter(String file)
              throws FileNotFoundException
Constructs a writer on a file.

Parameters:
file - the name of the file.

MGXTubeWriter

public MGXTubeWriter(OutputStream os)
Constructs a writer on a stream.

Parameters:
os - the stream.
Method Detail

add

public void add(Object object)
Add an object to write in the file. This method provides a simple way of write your objects in a file. When the Writer is created you just add your objects and it will be written when calling the write() function. The add may fail if the object you write is not recognize by the file format you use. It will be ignored.

Specified by:
add in interface WriterInterface
Overrides:
add in class MGLWriter

write

public void write()
Write the file with all objects added in the Writer. This open, then write the file and close it. All recognized objects added with the add() method are written.

Specified by:
write in interface WriterInterface
Overrides:
write in class MGLWriter