mysql
Class GenericStarDatabase

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by mysql.GenericSql
                  extended by mysql.GenericStarDatabase
All Implemented Interfaces:
Cloneable, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
HipparchosDatabase, Ucac2Database

public abstract class GenericStarDatabase
extends GenericSql

A class that allows access to databases holding stellar information. As it extends the GenericSql class, only a single bridge, i.e. a single database-type can be loaded per VM (or, per classloader). This class knows how to convert the relevant fields found in the database into StarDescription objects out of a result set. Special databases using callable statements etc. must subclass this class. This class is therefore abstract, daughter must implement how to convert a central star, given as a StarDescription and a (circular) field into a result-set.


Nested Class Summary
 
Nested classes/interfaces inherited from class mysql.GenericSql
GenericSql.Extract
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFEPOCHCALC
          The default epoch expression.
private static String DEFEQUINOXCALC
          The default equinox expression.
static String KEY_COLORCALC
          The key linked to the color expression.
static String KEY_DECALC
          The key linked to the declination expression.
static String KEY_EPOCHCALC
          The key linked to the epoch expression.
static String KEY_EQUINOXCALC
          The key linked to the equinox expression.
static String KEY_MAGCALC
          The key linked to the magnitude expression.
static String KEY_NAME
          The key linked to the Table field that is the name.
static String KEY_PMDECALC
          The key linked to the proper motion in de expression.
static String KEY_PMRACALC
          The key linked to the proper motion in ra expression.
static String KEY_RACALC
          The key linked to the right ascension expression.
 
Fields inherited from class mysql.GenericSql
DEFDATEFORMAT, KEY_BRIDGE, KEY_CONNECT, KEY_DATEFORMAT, KEY_FAILFILE, KEY_PASSWORD, KEY_TABLE, KEY_TRUEREAD, KEY_TRUEWRITE, KEY_USER
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
GenericStarDatabase(Map prop)
          Constructs a new generic star database.
 
Method Summary
 List convertResultToStarList(ResultSet rs)
          Converts a result set to a list of StarDescription objects.
private static Number evaluate(Node eval, String node, ResultSet row)
          Converts the current result set row into a number.
abstract  ResultSet getCircularField(StarDescription center, double radius)
          Takes a central star and a circular radius around it to convert it to a database query result set, which is then passed to the convertResultToStarList(java.sql.ResultSet) method.
 
Methods inherited from class mysql.GenericSql
allColumns, canRead, canWrite, close, delete, exit, getConnection, getStatement, init, insert, isOpen, isReady, join, open, replace, retrieve, retrieve
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_NAME

public static final String KEY_NAME
The key linked to the Table field that is the name.

See Also:
Constant Field Values

KEY_RACALC

public static final String KEY_RACALC
The key linked to the right ascension expression.

See Also:
Constant Field Values

KEY_DECALC

public static final String KEY_DECALC
The key linked to the declination expression.

See Also:
Constant Field Values

KEY_PMRACALC

public static final String KEY_PMRACALC
The key linked to the proper motion in ra expression.

See Also:
Constant Field Values

KEY_PMDECALC

public static final String KEY_PMDECALC
The key linked to the proper motion in de expression.

See Also:
Constant Field Values

KEY_MAGCALC

public static final String KEY_MAGCALC
The key linked to the magnitude expression.

See Also:
Constant Field Values

KEY_COLORCALC

public static final String KEY_COLORCALC
The key linked to the color expression.

See Also:
Constant Field Values

KEY_EPOCHCALC

public static final String KEY_EPOCHCALC
The key linked to the epoch expression.

See Also:
Constant Field Values

KEY_EQUINOXCALC

public static final String KEY_EQUINOXCALC
The key linked to the equinox expression.

See Also:
Constant Field Values

DEFEQUINOXCALC

private static final String DEFEQUINOXCALC
The default equinox expression.

See Also:
Constant Field Values

DEFEPOCHCALC

private static final String DEFEPOCHCALC
The default epoch expression.

See Also:
Constant Field Values
Constructor Detail

GenericStarDatabase

public GenericStarDatabase(Map prop)
Constructs a new generic star database. The connection data are part of the parent class, while this class takes expressions on how to convert individual results from the result set to StarDescriptions. Keys that are not defined mean that they are not present in the database.

Method Detail

getCircularField

public abstract ResultSet getCircularField(StarDescription center,
                                           double radius)
Takes a central star and a circular radius around it to convert it to a database query result set, which is then passed to the convertResultToStarList(java.sql.ResultSet) method.

Parameters:
center - The central star/position.
radius - Radius of the circular field around the center, degrees.

convertResultToStarList

public List convertResultToStarList(ResultSet rs)
Converts a result set to a list of StarDescription objects. Only the fields that can be set using the database result are set.


evaluate

private static Number evaluate(Node eval,
                               String node,
                               ResultSet row)
Converts the current result set row into a number.