|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.aerith.misao.catalog.io.CatalogReader | +--net.aerith.misao.catalog.io.FileReader
The FileReader
is a base class to read a star catalog
file. It has a method createStar
to create a
CatalogStar
object from one line record of the file,
which must be overrided in the subclasses.
When the filename ends with ".gz" suffix, it opens the file through
GZIPInputStream
.
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 CircumArea |
circum_area
The circum area to read stars. |
protected long |
current_block
The index of the current block. |
protected long |
current_index
The index of the star in the current block. |
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 | |
protected |
FileReader()
Constructs an empty FileReader . |
Method Summary | |
void |
close()
Closes a catalog. |
CatalogStar |
createStar(java.lang.String record)
Creates a CatalogStar object from the specified
one line record in the file. |
long |
getBlockCount()
Gets the number of blocks in a file. |
long |
getBlockSize()
Gets the number of records in a block. |
java.lang.String |
getName()
Gets the catalog name. |
long |
getRecordSize()
Gets the characters of a record. |
boolean |
isFile()
Checks if the catalog data is a file. |
void |
open(Coor coor,
double fov)
Opens a catalog. |
boolean |
overlapsBlock()
Checks if the current block is overlapping on the specified circum area. |
CatalogStar |
readNext()
Reads one data from the opened catalog. |
Methods inherited from class net.aerith.misao.catalog.io.CatalogReader |
addURL,
getDateLimit,
getDateLimitMessage,
getFovLimit,
getFovLimitMessage,
getHelpMessage,
getMaximumPositionErrorInArcsec,
hasDateLimit,
hasFovLimit,
isDateDependent,
isInDirectory,
open,
read,
setDate,
setDefaultURL,
setLimitingMagnitude,
supportsExamination |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected java.io.BufferedReader reader
protected CircumArea circum_area
protected long current_block
protected long current_index
Constructor Detail |
protected FileReader()
FileReader
.Method Detail |
public java.lang.String getName()
public boolean isFile()
public CatalogStar createStar(java.lang.String record)
CatalogStar
object from the specified
one line record in the file. If some more records are required
to create a star object, it returns null. This method must be
overrided in the subclasses.record
- the one line record in the file.public void open(Coor coor, double fov) throws java.io.IOException, java.io.FileNotFoundException, CdromNotFoundException
coor
- the R.A. and Decl. of the center.fov
- the field of view to read in degree.public CatalogStar readNext() throws java.io.IOException, java.io.FileNotFoundException, CdromNotFoundException, QueryFailException
The check of the R.A. and Decl. is also judged in this method, however, no check of magnitude is judged because some catalog stars have no significant magnitude. subclasses.
public void close() throws java.io.IOException
public long getBlockCount()
public long getBlockSize()
public long getRecordSize()
public boolean overlapsBlock()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |