net.agmodel.genericBroker
Class DataSourceDetail

java.lang.Object
  |
  +--net.agmodel.genericBroker.DataSourceDetail
All Implemented Interfaces:
Comparable, Serializable
Direct Known Subclasses:
ChizuSourceDetail, DEMSourceDetail, MetSourceDetail

public class DataSourceDetail
extends Object
implements Serializable, Comparable

Holds a general description of a database containing spatially-oriented agricultural information.
Used by GenericBrokerRMI to pass database metadata to client applications, so Serializable.
Includes the concept of default display region, which is a small "sample" of the data set suitable as a starting point for a graphical display (eg, show Mt Fuji or Tokyo Bay as a starting point for a database covering the whole of Japan).
Descendant classes describe particular kinds of databases (eg weather, maps, soils).

See Also:
Serialized Form

Field Summary
protected  GeographicalArea bounds
           
protected  GeographicalArea defaultDisplayRegion
           
protected  String ID
           
protected  int loginRequirements
           
protected  String sourceName
           
 
Constructor Summary
DataSourceDetail(String ID, String sourceName, GeographicalArea coverage, int loginRequirements)
          Creates a data source description with default display region the same as coverage
DataSourceDetail(String ID, String sourceName, GeographicalArea coverage, int loginRequirements, GeographicalArea defaultDisplayRegion)
          Create a description of this database
 
Method Summary
 int compareTo(Object o)
           
 GeographicalArea getDefaultDisplayRegion()
          A (small) sample area to display when the database is selected, particularly important if the database covers a wide area.
 GeographicalArea getGeographicalArea()
          The portion of the globe that the database covers
 String getID()
          Returns a unique ID which programs can use to identify the database.
 int getLoginRequirements()
          Indicate the usercode and password detail that need to be supplied by users of the database Use the constants included with this interface.
 String getName()
          The name of the database, suitable for presentation to the user.
 String toString()
          The default to String is the name of the data source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

loginRequirements

protected int loginRequirements

ID

protected String ID

sourceName

protected String sourceName

bounds

protected GeographicalArea bounds

defaultDisplayRegion

protected GeographicalArea defaultDisplayRegion
Constructor Detail

DataSourceDetail

public DataSourceDetail(String ID,
                        String sourceName,
                        GeographicalArea coverage,
                        int loginRequirements,
                        GeographicalArea defaultDisplayRegion)
Create a description of this database

Parameters:
ID - the identifier assigned by the broker to this database and used internally by applications.
sourceName - the name of this database in the user's preferred language
coverage - the area of the world that this database covers
loginRequirements - whether this database requires that the user log in (see constants in GenericBrokerRMI)
defaultDisplayRegion - an (interesting) sample display region for this database.

DataSourceDetail

public DataSourceDetail(String ID,
                        String sourceName,
                        GeographicalArea coverage,
                        int loginRequirements)
Creates a data source description with default display region the same as coverage

Parameters:
ID - the identifier assigned by the broker to this database and used internally by applications.
sourceName - the name of this database in the user's preferred language
coverage - the area of the world that this database covers
loginRequirements - whether this database requires that the user log in (see constants in GenericBrokerRMI)
Method Detail

getID

public String getID()
Returns a unique ID which programs can use to identify the database.

Returns:
the ID that MetBroker uses for the database

getName

public String getName()
The name of the database, suitable for presentation to the user.

Returns:
the name of the database

getGeographicalArea

public GeographicalArea getGeographicalArea()
The portion of the globe that the database covers

Returns:
a GeographicalArea which encompasses the locations of all the stations in the database.

getDefaultDisplayRegion

public GeographicalArea getDefaultDisplayRegion()
A (small) sample area to display when the database is selected, particularly important if the database covers a wide area.

Returns:
a GeographicalArea which can be used rather than the area bounds.

getLoginRequirements

public int getLoginRequirements()
Indicate the usercode and password detail that need to be supplied by users of the database Use the constants included with this interface.


toString

public String toString()
The default to String is the name of the data source

Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable