net.aerith.misao.catalog.io
Class MinorPlanetCheckerReader

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogReader
        |
        +--net.aerith.misao.catalog.io.MinorPlanetCheckerReader

public class MinorPlanetCheckerReader
extends CatalogReader

The MinorPlanetCheckerReader is a class to send queries to the Minor Planet Checker server, receive the results and read them.

The (x,y) position is also set properly so that (0,0) represents the specified R.A. and Decl. to open method and (1,1) represents the position 1 deg to the west and 1 deg to the north.


Field Summary
protected  boolean body_flag
          True if the comets and asteroids data part is being read.
protected  int current_area
          The current number of search areas.
protected  java.util.Hashtable hash
          The hash table to avoid duplication.
protected  java.util.Vector map_list
          The list of search areas.
protected  int radius_arcmin
          The radius to search in arcmin.
protected  java.io.BufferedReader reader
          The input stream reader.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogReader
center_coor, date, limiting_mag, url_set
 
Constructor Summary
MinorPlanetCheckerReader()
          Constructs an empty MinorPlanetCheckerReader.
 
Method Summary
 void close()
          Closes a catalog.
 double getDateLimit()
          Gets the limit on the date.
 java.lang.String getDateLimitMessage()
          Gets the message for limit on the date.
 double getFovLimit()
          Gets the limit on the field of view.
 java.lang.String getFovLimitMessage()
          Gets the message for limit on the field of view.
 java.lang.String getHelpMessage()
          Gets the help message.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
 java.lang.String getName()
          Gets the catalog name.
 boolean hasDateLimit()
          Returns true if the reader has limit on the date.
 boolean hasFovLimit()
          Returns true if the reader has limit on the field of view.
 boolean isDateDependent()
          Checks if the catalog depends on the date.
 void open(Coor coor, double fov)
          Opens a catalog.
 CatalogStar readNext()
          Reads one data from the opened catalog.
protected static boolean startsWith(java.lang.String target_string, java.lang.String key_string)
          Checkes if the specified target string is starting with the specified key string.
 
Methods inherited from class net.aerith.misao.catalog.io.CatalogReader
addURL, isFile, isInDirectory, open, read, setDate, setDefaultURL, setLimitingMagnitude, supportsExamination
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

reader

protected java.io.BufferedReader reader
The input stream reader.

radius_arcmin

protected int radius_arcmin
The radius to search in arcmin.

map_list

protected java.util.Vector map_list
The list of search areas.

hash

protected java.util.Hashtable hash
The hash table to avoid duplication.

current_area

protected int current_area
The current number of search areas.

body_flag

protected boolean body_flag
True if the comets and asteroids data part is being read.
Constructor Detail

MinorPlanetCheckerReader

public MinorPlanetCheckerReader()
Constructs an empty MinorPlanetCheckerReader.
Method Detail

getName

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

isDateDependent

public boolean isDateDependent()
Checks if the catalog depends on the date.
Overrides:
isDateDependent in class CatalogReader
Returns:
true if the catalog depends on the date.

hasFovLimit

public boolean hasFovLimit()
Returns true if the reader has limit on the field of view.
Overrides:
hasFovLimit in class CatalogReader
Returns:
true if the reader has limit on the field of view.

getFovLimit

public double getFovLimit()
Gets the limit on the field of view.
Overrides:
getFovLimit in class CatalogReader
Returns:
the limit on the field of view in degree.

getFovLimitMessage

public java.lang.String getFovLimitMessage()
Gets the message for limit on the field of view.
Overrides:
getFovLimitMessage in class CatalogReader
Returns:
the message for limit on the field of view.

hasDateLimit

public boolean hasDateLimit()
Returns true if the reader has limit on the date.
Overrides:
hasDateLimit in class CatalogReader
Returns:
true if the reader has limit on the date.

getDateLimit

public double getDateLimit()
Gets the limit on the date.
Overrides:
getDateLimit in class CatalogReader
Returns:
the limit on the date in day.

getDateLimitMessage

public java.lang.String getDateLimitMessage()
Gets the message for limit on the date.
Overrides:
getDateLimitMessage in class CatalogReader
Returns:
the message for limit on the date.

getMaximumPositionErrorInArcsec

public double getMaximumPositionErrorInArcsec()
Gets the maximum error of position in arcsec. It is the search area size to identify with other stars.
Overrides:
getMaximumPositionErrorInArcsec in class CatalogReader
Returns:
the maximum error of position in arcsec.

getHelpMessage

public java.lang.String getHelpMessage()
Gets the help message.
Overrides:
getHelpMessage in class CatalogReader
Returns:
the help message.

startsWith

protected static boolean startsWith(java.lang.String target_string,
                                    java.lang.String key_string)
Checkes if the specified target string is starting with the specified key string.
Parameters:
target_string - the string to check if starting with the specified key string.
key_string - the string to check if the target string is starting with.
Returns:
true if the specified target string is starting with the specified key string.

open

public void open(Coor coor,
                 double fov)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 CdromNotFoundException
Opens a catalog. This method must be invoked at first.
Overrides:
open in class CatalogReader
Parameters:
coor - the R.A. and Decl. of the center.
fov - the field of view to read in degree.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL, and the file is in any CD-ROMs.
CdromNotFoundException - if a file does not exists in any URL, and the file is in a CD-ROM.

readNext

public CatalogStar readNext()
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads one data from the opened catalog. After this method is invoked, the cursor is promoted to tne next star. When every data is read, it returns null. Note that data with the same ID are also returned one by one.
Overrides:
readNext in class CatalogReader
Returns:
a star data.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL, and the file is in any CD-ROMs.
CdromNotFoundException - if a file does not exists in any URL, and the file is in a CD-ROM.
QueryFailException - if the query to the server is failed.

close

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