|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.agmodel.physical.StoreImpl
|
+--net.agmodel.physical.SynchronousStoreImpl
An implementation of Store which uses an array to store data and their derivation Most suitable for regularly spaced data which continually fluctuate, such as hourly temperatures
| Field Summary | |
protected static byte |
COVERAGEMASK
|
protected static byte |
SPATIALMASK
|
protected static byte |
TEMPORALMASK
|
| Fields inherited from class net.agmodel.physical.StoreImpl |
dateRange, history, name |
| Constructor Summary | |
SynchronousStoreImpl(Interval dateRange,
SummaryHistory history,
String name)
|
|
| Method Summary | |
Object |
clone()
|
String |
dumpSequence(DateFormat df,
String delimiter,
String rowTerminator)
Gets a printable version of the sequence contents. |
JigsawQuantity |
getAverage(Interval interval)
Returns the average value of the time series over the interval. |
int |
getCapacity()
Returns the number of possible data values in the store. |
String |
getContentsAsString(Date date,
String delimiter)
Returns the measurement associated with a particular time as a string. |
float[] |
getCoverage()
Creates an array representing the coverage of the data returned by getData(). |
double[] |
getData()
Creates an array containing the data from the store. |
protected float |
getDerivation(int index)
|
JigsawQuantity |
getInstant(Date time)
Returns the instantaneous value of the time series at a particular point in time. |
JigsawQuantity |
getMaximum(Interval interval)
Returns the maximum value of the time series over the interval. |
JigsawQuantity |
getMinimum(Interval interval)
Returns the minimum value of the time series over the interval. |
int |
getNumberOfSubComponents()
Get the number of sub-components in the sequence. |
double |
getNumberOfValues()
Returns the number of data values in the store |
String |
getSequenceHeading(String delimiter)
Returns a localized top level description of the kind of data stored in the sequence. |
protected boolean |
getSpatialInterpolation(int index)
|
String |
getSubHeading(String delimiter)
Gets a localized subheading, assumed to be in the context of an overall column heading. |
protected boolean |
getTemporalInterpolation(int index)
|
JigsawQuantity |
getTotal(Interval interval)
Returns the total value of the sequence over the interval. |
String |
getUnitsHeading(String delimiter)
Gets a string representation of the measurement units of the column. |
protected Store |
makeExtendedStore(Interval interval)
Creates a new store at the same resolution as this one but covering a different DateRange. |
protected Store |
makeSummarizedStore(Duration newResolution,
SummaryKind summaryType,
String newName)
Creates a new, empty store at a lower temporal resolution covering the same dateRange. |
protected int |
numbValues()
|
void |
putInstantValue(Date time,
double value)
Records the instantaneous value of the time series at a particular time |
void |
putValueOverInterval(Interval interval,
double value)
Records the value of the timeseries over some subinterval. |
void |
putValueOverInterval(Interval interval,
JigsawQuantity value)
Records the value of the timeseries over some subinterval, its coverage, and the extent to which it was interpolated. |
protected void |
setDerivation(int index,
float coverage,
boolean temporal,
boolean spatial)
|
protected JigsawQuantity |
summarizeOverInterval(Interval interval,
SummaryKind summaryKind)
|
String |
toString()
|
| Methods inherited from class net.agmodel.physical.StoreImpl |
averageStore, averageStore, extendStore, extendStore, getColumnHeading, getCurrentResolution, getDateRange, getName, getResolution, getSummaryHistory, getSummaryKind, maximumStore, maximumStore, minimumStore, minimumStore, sampleStore, sampleStore, setColumnHeading, setName, totalStore, totalStore |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static byte SPATIALMASK
protected static byte TEMPORALMASK
protected static byte COVERAGEMASK
| Constructor Detail |
public SynchronousStoreImpl(Interval dateRange,
SummaryHistory history,
String name)
| Method Detail |
protected int numbValues()
public double getNumberOfValues()
Store
getNumberOfValues in interface Storepublic int getCapacity()
protected float getDerivation(int index)
protected void setDerivation(int index,
float coverage,
boolean temporal,
boolean spatial)
protected boolean getSpatialInterpolation(int index)
protected boolean getTemporalInterpolation(int index)
public JigsawQuantity getInstant(Date time)
Store
getInstant in interface StoregetInstant in class StoreImplpublic JigsawQuantity getTotal(Interval interval)
Store
getTotal in interface StoregetTotal in class StoreImpl
protected JigsawQuantity summarizeOverInterval(Interval interval,
SummaryKind summaryKind)
public JigsawQuantity getAverage(Interval interval)
Store
getAverage in interface StoregetAverage in class StoreImplpublic JigsawQuantity getMaximum(Interval interval)
Store
getMaximum in interface StoregetMaximum in class StoreImplpublic JigsawQuantity getMinimum(Interval interval)
Store
getMinimum in interface StoregetMinimum in class StoreImpl
public void putInstantValue(Date time,
double value)
Store
putInstantValue in interface StoreputInstantValue in class StoreImpltime - the point in timevalue - the value of the time series at that time
public void putValueOverInterval(Interval interval,
double value)
Store
putValueOverInterval in interface StoreputValueOverInterval in class StoreImplinterval - the period of time over which the measurement was taken. Interval duration must a postive integer multiple of store resolution, and the interval must align with the store "cells".value - the value of the time series over that interval
public void putValueOverInterval(Interval interval,
JigsawQuantity value)
Store
putValueOverInterval in interface StoreputValueOverInterval in class StoreImplinterval - the period of time over which the measurement was taken. Interval duration must a positive integer multiple of store resolution, and the interval must align with the store "cells".value - the value of the time series over that interval as a JigsawQuantitypublic String getSequenceHeading(String delimiter)
Sequence
getSequenceHeading in interface Sequencedelimiter - the delimiter to use if padding is required for multiple columnspublic String getSubHeading(String delimiter)
Sequence
getSubHeading in interface Sequencedelimiter - the delimiter to use between columns if there are multiple columnsSequence.getNumberOfSubComponents(),
Sequence.getSequenceHeading(String)public String getUnitsHeading(String delimiter)
Sequence
getUnitsHeading in interface Sequencedelimiter - the delimiter to use between columns if there are multiple columnsSequence.getNumberOfSubComponents(),
Sequence.getSequenceHeading(String),
Sequence.getSubHeading(String)public int getNumberOfSubComponents()
Sequence
getNumberOfSubComponents in interface SequenceSequence.getSequenceHeading(String)
protected Store makeSummarizedStore(Duration newResolution,
SummaryKind summaryType,
String newName)
StoreImpl
makeSummarizedStore in class StoreImplnewResolution - the resolution of the resulting storesummaryType - the way in which data will be summarised to make the new store.newName - the name for the new store
protected Store makeExtendedStore(Interval interval)
StoreImpl
makeExtendedStore in class StoreImplinterval - the interval that the new store covers.
public String getContentsAsString(Date date,
String delimiter)
Sequence
getContentsAsString in interface Sequencedate - the time of interest.delimiter - a string to use between values if required.
public String dumpSequence(DateFormat df,
String delimiter,
String rowTerminator)
Sequence
dumpSequence in interface Sequencedf - the format to use for the date and timedelimiter - the separator to use between the date and the datarowTerminator - the String used at the end of each row
public double[] getData()
StoreStore.getCoverage() to test for the coverage.
(Missing values are returned as Double.NaN at present, but this might change.)
getData in interface StoregetData in class StoreImplpublic float[] getCoverage()
StoreStore.getData().
getCoverage in interface StoregetCoverage in class StoreImplpublic Object clone()
clone in interface Sequenceclone in class StoreImplpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||