|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Catalog
Catalog interface providing reference fields for primary catalog data types.
| Field Summary | |
|---|---|
static int |
MAX_SIZE
Maximum size of a catalog; currently set to 800,000 events. |
| Method Summary | |
|---|---|
void |
addData(DataType type,
Object data)
Adds an array of data of the specified type to this catalog. |
boolean |
contains(DataType type)
Returns whether this catalog contains a particular DataType. |
Object |
getData(DataType type)
Returns a copy of the requested data type or null if the
DataType is not present in this catalog. |
Date |
getDate(int index)
Returns the Date of the event at index. |
int |
getEventID(int index)
Returns the eventID of the event at index. |
String |
getEventString(int index)
Returns a string representation of the event at a given index. |
String |
getEventStringWithID(int index)
Returns a string representation of the event at a given index. |
long |
getTime(int index)
Returns the time of the event at index (in milliseconds). |
double |
getValue(DataType type,
int index)
Returns the value of a the requested DataType for the event
at the specified index. |
Date |
maxDate()
Returns end date of this catalog or null if it is not set. |
double |
maxForType(DataType type)
Returns the maximum value of the requested DataType. |
Date |
minDate()
Returns start date of this catalog or null if it is not set. |
double |
minForType(DataType type)
Returns the minimum value of the requested DataType. |
boolean |
readable()
Returns whether copies of or references to internal data are provided by getData(). |
int |
size()
Returns the number of events in this catalog or -1 if the catalog is empty. |
| Field Detail |
|---|
static final int MAX_SIZE
| Method Detail |
|---|
void addData(DataType type,
Object data)
type - of data to be addeddata - array to be added
NullPointerException - if type or data
are null
IllegalArgumentException - if (1) type already exists
in catalog, (2) data is not an array, (3)
data is not of the class specified by
DataType.clazz(), (4) data is longer than
MAX_SIZE, (5) data is not the first array being
added and data.length != size(), or (6)
type is DataType.TIME and
data is not sorted ascending
IllegalArgumentException - if type is one of
[LONGITUDE, LATITUDE, DEPTH, MAGNITUDE] and data contains values
that are out of range for the typeObject getData(DataType type)
null if the
DataType is not present in this catalog. Implementations may
return a reference or a deep copy of the requested data array.
type - requested
int size()
boolean contains(DataType type)
DataType.
type - to look for
boolean readable()
getData().
String getEventString(int index)
index - of event
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include magnitude or
date valuesString getEventStringWithID(int index)
index - of event
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include event ID,
magnitude or date valuesint getEventID(int index)
index - of event
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include event ID valueslong getTime(int index)
index - of event
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include event time
valuesDate getDate(int index)
Date of the event at index.
index - of event
Date of the event
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include event time
valuesDate minDate()
null if it is not set.
DateDate maxDate()
null if it is not set.
Date
double getValue(DataType type,
int index)
DataType for the event
at the specified index. Method is only valid for the following
double-valued DataTypes: [LONGITUDE, LATITUDE, DEPTH,
MAGNITUDE]
type - requestedindex - of event
type value at event index
NullPointerException - if type is null
IllegalArgumentException - if requested type is not
valid
IndexOutOfBoundsException - if requested index is out of range
IllegalStateException - if catalog does not include values for the
requested typedouble minForType(DataType type)
DataType. Method
is only valid for the following double-valued DataTypes:
[LONGITUDE, LATITUDE, DEPTH, MAGNITUDE]
type - requested
DatType
NullPointerException - if type is null
IllegalArgumentException - if requested type is not
valid
IllegalStateException - if requested type is valid but
was never added to catalogdouble maxForType(DataType type)
DataType. Method
is only valid for the following double-valued DataTypes:
[LONGITUDE, LATITUDE, DEPTH, MAGNITUDE]
type - requested
DatType
NullPointerException - if type is null
IllegalArgumentException - if requested type is not
valid
IllegalStateException - if requested type is valid but
was never added to catalog
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||