|
|||||||
| 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 TimeSeries.Block class and containing array of time series elements. Size of this array specifies the size of the block.
| Nested Class Summary | |
|---|---|
static class |
TimeSeries.Block
Abstract base class for time series block. |
static interface |
TimeSeries.Tick
Interface for timeseries element. |
| Method Summary | |
|---|---|
boolean |
add(T tick)
Add new tick to time series |
long |
countTicks()
Get number of elements in time series |
java.util.ArrayList<T> |
elements()
Get list of alements in the time series (in ascending order) |
java.util.Date |
getFirstTime()
Get timestamp of first time series element |
java.util.Date |
getLastTime()
Get timestamp of last time series element |
T |
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<T> |
iterator()
Get forward iterator through all time series elements This iterator doesn't support remove() method. |
IterableIterator<T> |
iterator(boolean ascent)
Get iterator through all time series elements This iterator doesn't support remove() method. |
IterableIterator<T> |
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. |
IterableIterator<T> |
iterator(java.util.Date from,
java.util.Date till,
boolean ascent)
Get forward iterator for time series elements belonging to the specified range This iterator doesn't support remove() method. |
int |
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 |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Method Detail |
|---|
boolean add(T tick)
tick - new time series elementlong countTicks()
java.util.ArrayList<T> elements()
java.util.Date getFirstTime()
java.util.Date getLastTime()
T 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 foundboolean has(java.util.Date timestamp)
timestamp - time series element timestamp
true if there is element in time series with such timestamp,
false otherwisejava.util.Iterator<T> iterator()
iterator in interface java.util.CollectionIterableIterator<T> iterator(boolean ascent)
ascent - direction of iteration
IterableIterator<T> 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
IterableIterator<T> 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
int 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
int size()
size in interface java.util.Collection
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||