public abstract class OfflineDataMap<TmapPoint extends OfflineDataMapPoint>
extends java.lang.Object
It is possible that some datablocks may own two of these things - one for database data and one for binary stored data.
Modifier and Type | Field and Description |
---|---|
static int |
AFTER_LAST |
static int |
BEFORE_FIRST |
static int |
IN_DATA |
static int |
IN_GAP |
static int |
NO_DATA |
static int |
POINT_END |
static int |
POINT_START |
static int |
SCALE_NONE
Vertical scaling - scale each Map data point to
a data rate, or don't bother scaling at all.
|
static int |
SCALE_PERDAY |
static int |
SCALE_PERHOUR |
static int |
SCALE_PERMINUTE |
static int |
SCALE_PERSECOND |
Constructor and Description |
---|
OfflineDataMap(OfflineDataStore offlineDataStore,
PamDataBlock parentDataBlock) |
Modifier and Type | Method and Description |
---|---|
void |
addDataPoint(TmapPoint mapPoint)
Add a new map point into the list.
|
void |
clear()
Clear the data map.
|
void |
compareLists(java.util.List<TmapPoint> list1,
java.util.List<TmapPoint> list2)
Compare two map point lists and see which of list1 are in list 2 and which
of list 2 are in list 1.
|
TmapPoint |
findMapPoint(long timeMillis)
find a map point for a given time in milliseconds
|
int |
getDataCount() |
long |
getFirstDataTime() |
double |
getHighestPoint(int vScaleType)
Return the highest point on the map using the given scale
|
long |
getLastDataTime() |
java.util.Iterator<TmapPoint> |
getListIterator()
Get an iterator over the map contents.
|
double |
getLowestNonZeroPoint(int vScaleType) |
double |
getLowestPoint(int vScaleType) |
java.util.List<TmapPoint> |
getMapPoints() |
java.util.List<TmapPoint> |
getMapPoints(long dataStart,
long dataEnd)
Get a list of map points that cover the given times
|
long |
getNextDataStart(long timeMillis)
Get the next data start point.
|
int |
getNumMapPoints() |
int |
getNumMapPoints(long firstTime,
long endTime)
Get the number of map points AFTER or INCLUDING a given time
|
OfflineDataStore |
getOfflineDataSource() |
PamDataBlock |
getParentDataBlock() |
long |
getPrevDataEnd(long timeMillis)
Get the previous data end point.
|
java.util.List<TmapPoint> |
getRootlessMapPoints() |
DataMapDrawing |
getSpecialDrawing() |
int |
isInGap(long timeMillis)
Work out where the time is within a map.
|
int |
removeDuplicates()
Needed to sort out some damaged binary data maps
which are corrupted by being opened in viewer while data still writing.
|
static double |
scaleData(double count,
long duration,
int scaleType) |
void |
setFirstDataTime(long firstDataTime) |
void |
setLastDataTime(long lastDataTime) |
void |
setMapPoints(java.util.List<TmapPoint> mapPoints) |
void |
setParentDataBlock(PamDataBlock parentDataBlock) |
void |
setSpecialDrawing(DataMapDrawing specialDrawing) |
void |
sortMapPoints()
Sort all map points into ascending order based on start time.
|
void |
sortRanges()
Called after de-serailisation of a data map so that
the min and max times stored in this object (which is not
serialised can be extracted from the list of data which
WAS serialised.
|
public static final int SCALE_NONE
public static final int SCALE_PERSECOND
public static final int SCALE_PERMINUTE
public static final int SCALE_PERHOUR
public static final int SCALE_PERDAY
public static final int IN_GAP
public static final int BEFORE_FIRST
public static final int AFTER_LAST
public static final int POINT_START
public static final int POINT_END
public static final int IN_DATA
public static final int NO_DATA
public OfflineDataMap(OfflineDataStore offlineDataStore, PamDataBlock parentDataBlock)
public java.util.Iterator<TmapPoint> getListIterator()
Objects using this iterator should synchronise on the map object first.
public PamDataBlock getParentDataBlock()
public void setParentDataBlock(PamDataBlock parentDataBlock)
parentDataBlock
- the parentDataBlock to setpublic void clear()
public void addDataPoint(TmapPoint mapPoint)
mapPoint
- new map point to addpublic int getNumMapPoints()
public int getNumMapPoints(long firstTime, long endTime)
firstTime
- time to start search.public void sortMapPoints()
this should be called after all data have been loaded.
public int removeDuplicates()
public void sortRanges()
public long getFirstDataTime()
public void setFirstDataTime(long firstDataTime)
firstDataTime
- the firstDataTime to setpublic long getLastDataTime()
public void setLastDataTime(long lastDataTime)
lastDataTime
- the lastDataTime to setpublic int getDataCount()
public double getHighestPoint(int vScaleType)
vScaleType
- scale typepublic double getLowestPoint(int vScaleType)
public double getLowestNonZeroPoint(int vScaleType)
public static double scaleData(double count, long duration, int scaleType)
public OfflineDataStore getOfflineDataSource()
public DataMapDrawing getSpecialDrawing()
public void setSpecialDrawing(DataMapDrawing specialDrawing)
specialDrawing
- the specialDrawing to setpublic int isInGap(long timeMillis)
timeMillis
- timeNO_DATA
BEFORE_FIRST
AFTER_LAST
POINT_START
POINT_END
IN_GAP
IN_DATA
public TmapPoint findMapPoint(long timeMillis)
timeMillis
- time in millisecondspublic long getNextDataStart(long timeMillis)
timeMillis
- current time in millisecondspublic long getPrevDataEnd(long timeMillis)
timeMillis
- current time in millisecondspublic java.util.List<TmapPoint> getMapPoints()
public java.util.List<TmapPoint> getMapPoints(long dataStart, long dataEnd)
dataStart
- start timedataEnd
- end timepublic java.util.List<TmapPoint> getRootlessMapPoints()
public void setMapPoints(java.util.List<TmapPoint> mapPoints)
mapPoints
- the mapPoints to set