net.aerith.misao.catalog.io
Class CatalogWriter

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogWriter
Direct Known Subclasses:
AstrometricaWriter

public abstract class CatalogWriter
extends java.lang.Object

The CatalogWriter is an abstract class of catalog writer.


Field Summary
protected  java.io.File file
          The file to write the star data to.
 
Constructor Summary
CatalogWriter()
           
 
Method Summary
abstract  void close()
          Closes a catalog.
abstract  java.lang.String getName()
          Gets the catalog name.
abstract  void open()
          Opens a catalog to write star data.
 void setFile(java.io.File file)
          Sets the file to write the star data to.
abstract  void write(Star star)
          Writes one star to the opened catalog.
 void write(StarList list)
          Writes star data in the list.
 void writeAll(StarList list)
          Writes all star data.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

file

protected java.io.File file
The file to write the star data to.
Constructor Detail

CatalogWriter

public CatalogWriter()
Method Detail

getName

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

setFile

public void setFile(java.io.File file)
Sets the file to write the star data to.

open

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

write

public abstract void write(Star star)
                    throws java.io.IOException,
                           UnsupportedStarClassException
Writes one star to the opened catalog.
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 abstract void close()
                    throws java.io.IOException
Closes a catalog. This method must be invoked finally.
Throws:
java.io.IOException - if a file cannot be accessed.

write

public void write(StarList list)
           throws java.io.IOException,
                  UnsupportedStarClassException
Writes star data in the list.
Parameters:
list - the list of stars.
Throws:
java.io.IOException - if a file cannot be accessed.
UnsupportedStarClassException - if the specified star is not supported.

writeAll

public void writeAll(StarList list)
              throws java.io.IOException,
                     UnsupportedStarClassException
Writes all star data.
Parameters:
list - the list of stars.
Throws:
java.io.IOException - if a file cannot be accessed.
UnsupportedStarClassException - if the specified star is not supported.