|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Time series interface. Time series class is used for efficient handling of time series data. Ussually time series contains a very large number if relatively small elements which are ussually acessed in sucessive order. To avoid overhead of loading from the disk each particular time series element, this class group several subsequent time series elements together and store them as single object (block).
As far as Java currently has no templates and Perst need to know format of block class, it is responsibity of prgorammer to create block implementation derived from TimeSeriesBlock class and containing array of time series elements. Size of this array specifies the size of the block.
| Method Summary | |
void |
add(TimeSeriesTick tick)
Add new tick to time series |
long |
countTicks()
Get number of elements in time series |
java.util.Date |
getFirstTime()
Get timestamp of first time series element |
java.util.Date |
getLastTime()
Get timestamp of last time series element |
TimeSeriesTick |
getTick(java.util.Date timestamp)
Get tick for specified data |
boolean |
has(java.util.Date timestamp)
Check if data is available in time series for the specified time |
java.util.Iterator |
iterator()
Get forward iterator through all time series elements This iterator doesn't support remove() method. |
java.util.Iterator |
iterator(boolean ascent)
Get iterator through all time series elements This iterator doesn't support remove() method. |
java.util.Iterator |
iterator(java.util.Date from,
java.util.Date till)
Get forward iterator for time series elements belonging to the specified range This iterator doesn't support remove() method. |
java.util.Iterator |
iterator(java.util.Date from,
java.util.Date till,
boolean ascent)
Get forward iterator for time series elements belonging to the specified range. |
long |
remove(java.util.Date from,
java.util.Date till)
Remove timeseries elements belonging to the specified range |
int |
size()
Get number of elements in time series |
| Methods inherited from interface org.garret.perst.IPersistent |
assignOid, deallocate, getOid, getStorage, invalidate, isDeleted, isModified, isPersistent, isRaw, load, loadAndModify, makePersistent, modify, onLoad, onStore, recursiveLoading, store |
| Methods inherited from interface java.io.Externalizable |
readExternal, writeExternal |
| Methods inherited from interface org.garret.perst.IResource |
exclusiveLock, exclusiveLock, reset, sharedLock, sharedLock, unlock |
| Methods inherited from interface org.garret.perst.ITable |
select |
| Method Detail |
public void add(TimeSeriesTick tick)
tick - new time series elementpublic long countTicks()
public java.util.Date getFirstTime()
public java.util.Date getLastTime()
public TimeSeriesTick getTick(java.util.Date timestamp)
timestamp - time series element timestamp
return time series element for the specified timestamp or null
if no such element was foundpublic boolean has(java.util.Date timestamp)
timestamp - time series element timestamp
true if there is element in time series with such timestamp,
false otherwisepublic java.util.Iterator iterator()
iterator in interface ITablepublic java.util.Iterator iterator(boolean ascent)
ascent - direction of iteration
public java.util.Iterator iterator(java.util.Date from,
java.util.Date till)
from - inclusive time of the begging of interval,
if null then take all elements from the beginning of time seriestill - inclusive time of the ending of interval,
if null then take all elements till the end of time series
public java.util.Iterator iterator(java.util.Date from,
java.util.Date till,
boolean ascent)
from - inclusive time of the begging of interval,
if null then take all elements from the beginning of time seriestill - inclusive time of the ending of interval,
if null then take all elements till the end of time seriesascent - direction of iteration
public long remove(java.util.Date from,
java.util.Date till)
from - inclusive time of the begging of interval,
if null then remove all elements from the beginning of time seriestill - inclusive time of the ending of interval,
if null then remove all elements till the end of time series
public int size()
size in interface ITable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||