PamguardMVC
Class OfflineDataMap<TmapPoint extends OfflineDataMapPoint>

java.lang.Object
  extended by PamguardMVC.OfflineDataMap<TmapPoint>

public abstract class OfflineDataMap<TmapPoint extends OfflineDataMapPoint>
extends java.lang.Object

Class which get's held within a PamDataBlock which provides summary information on data within that block when operating in viewer mode.

It is possible that some datablocks may own two of these things - one for database data and one for binary stored data.

Author:
Doug Gillespie

Field Summary
private  long firstDataTime
          time of the first data available for this data block
private  long highestPoint
          Point in this store with most data.
private  long lastDataTime
          time of the last data available for this data block
private  long lowestNonZeroPoint
          Lowest non zero point in the store (can be zero if no data or if highestPoint is zero)
private  long lowestPoint
          Lowest point in this store (can be zero)
private  java.util.List<TmapPoint> mapPoints
           
private  OfflineDataStore offlineDataStore
           
private  PamDataBlock parentDataBlock
           
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
           
private  DataMapDrawing specialDrawing
           
 
Constructor Summary
OfflineDataMap(OfflineDataStore offlineDataStore, PamDataBlock parentDataBlock)
           
 
Method Summary
 void addDataPoint(TmapPoint mapPoint)
          Add a new map point into the list.
 long getFirstDataTime()
           
 double getHighestPoint(int vScaleType)
           
 long getLastDataTime()
           
 java.util.Iterator<TmapPoint> getListIterator()
          Get an iterator over the map contents.
 double getLowestNonZeroPoint(int vScaleType)
           
 double getLowestPoint(int vScaleType)
           
 int getNumMapPoints()
           
 OfflineDataStore getOfflineDataSource()
           
 PamDataBlock getParentDataBlock()
           
 DataMapDrawing getSpecialDrawing()
           
static double scaleData(double count, long duration, int scaleType)
           
 void setFirstDataTime(long firstDataTime)
           
 void setLastDataTime(long lastDataTime)
           
 void setSpecialDrawing(DataMapDrawing specialDrawing)
           
 void sortMapPoints()
          Sort all map points into ascending order based on start time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentDataBlock

private PamDataBlock parentDataBlock

offlineDataStore

private OfflineDataStore offlineDataStore

mapPoints

private java.util.List<TmapPoint extends OfflineDataMapPoint> mapPoints

specialDrawing

private DataMapDrawing specialDrawing

firstDataTime

private long firstDataTime
time of the first data available for this data block


lastDataTime

private long lastDataTime
time of the last data available for this data block


highestPoint

private long highestPoint
Point in this store with most data.


lowestPoint

private long lowestPoint
Lowest point in this store (can be zero)


lowestNonZeroPoint

private long lowestNonZeroPoint
Lowest non zero point in the store (can be zero if no data or if highestPoint is zero)


SCALE_NONE

public static final int SCALE_NONE
Vertical scaling - scale each Map data point to a data rate, or don't bother scaling at all.

See Also:
Constant Field Values

SCALE_PERSECOND

public static final int SCALE_PERSECOND
See Also:
Constant Field Values

SCALE_PERMINUTE

public static final int SCALE_PERMINUTE
See Also:
Constant Field Values

SCALE_PERHOUR

public static final int SCALE_PERHOUR
See Also:
Constant Field Values

SCALE_PERDAY

public static final int SCALE_PERDAY
See Also:
Constant Field Values
Constructor Detail

OfflineDataMap

public OfflineDataMap(OfflineDataStore offlineDataStore,
                      PamDataBlock parentDataBlock)
Method Detail

getListIterator

public java.util.Iterator<TmapPoint> getListIterator()
Get an iterator over the map contents.

Objects using this iterator should synchronise on the map object first.

Returns:
an iterator over the map contents.

getParentDataBlock

public PamDataBlock getParentDataBlock()
Returns:
the parentDataBlock

addDataPoint

public void addDataPoint(TmapPoint mapPoint)
Add a new map point into the list.

Parameters:
mapPoint - new map point to add

getNumMapPoints

public int getNumMapPoints()
Returns:
the total number of map points.

sortMapPoints

public void sortMapPoints()
Sort all map points into ascending order based on start time.

this should be called after all data have been loaded.


getFirstDataTime

public long getFirstDataTime()
Returns:
the firstDataTime

setFirstDataTime

public void setFirstDataTime(long firstDataTime)
Parameters:
firstDataTime - the firstDataTime to set

getLastDataTime

public long getLastDataTime()
Returns:
the lastDataTime

setLastDataTime

public void setLastDataTime(long lastDataTime)
Parameters:
lastDataTime - the lastDataTime to set

getHighestPoint

public double getHighestPoint(int vScaleType)
Parameters:
vScaleType -
Returns:
the highestPoint

getLowestPoint

public double getLowestPoint(int vScaleType)
Returns:
the lowestPoint

getLowestNonZeroPoint

public double getLowestNonZeroPoint(int vScaleType)
Returns:
the lowestNonZeroPoint

scaleData

public static double scaleData(double count,
                               long duration,
                               int scaleType)

getOfflineDataSource

public OfflineDataStore getOfflineDataSource()
Returns:
the offlineDataSource

getSpecialDrawing

public DataMapDrawing getSpecialDrawing()
Returns:
the specialDrawing

setSpecialDrawing

public void setSpecialDrawing(DataMapDrawing specialDrawing)
Parameters:
specialDrawing - the specialDrawing to set