net.aerith.misao.catalog.io
Class AstrometricaWriter

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogWriter
        |
        +--net.aerith.misao.catalog.io.AstrometricaWriter

public class AstrometricaWriter
extends CatalogWriter

The AstrometricaWriter is a class to write the stars into the Astrometrica Other(ASCII) Star Catalog.


Field Summary
protected  java.io.PrintWriter writer
          The output stream writer.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogWriter
file
 
Constructor Summary
AstrometricaWriter()
          Constructs an empty AstrometricaWriter.
AstrometricaWriter(java.io.File file)
          Constructs an AstrometricaWriter with the name of the catalog file.
 
Method Summary
 void close()
          Closes a catalog.
 java.lang.String getName()
          Gets the catalog name.
 void open()
          Opens a catalog to write star data.
 void write(Star star)
          Writes one star to the opened catalog.
 
Methods inherited from class net.aerith.misao.catalog.io.CatalogWriter
setFile, write, writeAll
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

writer

protected java.io.PrintWriter writer
The output stream writer.
Constructor Detail

AstrometricaWriter

public AstrometricaWriter()
Constructs an empty AstrometricaWriter.

AstrometricaWriter

public AstrometricaWriter(java.io.File file)
Constructs an AstrometricaWriter with the name of the catalog file.
Parameters:
file - the catalog file.
Method Detail

getName

public java.lang.String getName()
Gets the catalog name. It must be unique among all subclasses.
Overrides:
getName in class CatalogWriter
Returns:
the catalog name.

open

public void open()
          throws java.io.IOException
Opens a catalog to write star data. This method must be invoked at first.
Overrides:
open in class CatalogWriter
Throws:
java.io.IOException - if a file cannot be accessed.

write

public void write(Star star)
           throws java.io.IOException,
                  UnsupportedStarClassException
Writes one star to the opened catalog.
Overrides:
write in class CatalogWriter
Parameters:
star - the star data.
Throws:
java.io.IOException - if a file cannot be accessed.
UnsupportedStarClassException - if the specified star is not supported.

close

public void close()
           throws java.io.IOException
Closes a catalog. This method must be invoked finally.
Overrides:
close in class CatalogWriter
Throws:
java.io.IOException - if a file cannot be accessed.