|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.data.ValueProvider
simtools.data.DataSource
simtools.data.DynamicDataSource
public class DynamicDataSource
Field Summary | |
---|---|
protected boolean |
autoRegister
Set this to true to register the values as soon as they are set True by default, but this behaviour is not the same as the source collection so it can be set off |
protected byte |
cachedByte
current / cached values current values are positioned by setvalue but not registered yet cached values are registered and returned by the collection until the next register. |
protected double |
cachedDouble
|
protected float |
cachedFloat
|
protected int |
cachedInteger
|
protected long |
cachedLong
|
protected java.lang.Object |
cachedObject
|
protected short |
cachedShort
|
protected byte |
currentByte
current / cached values current values are positioned by setvalue but not registered yet cached values are registered and returned by the collection until the next register. |
protected double |
currentDouble
|
protected float |
currentFloat
|
protected int |
currentInteger
|
protected long |
currentLong
|
protected java.lang.Object |
currentObject
|
protected short |
currentShort
|
protected boolean |
hasValue
Whether or not values were set, or if they are unititialized. |
DataInfo |
info
This class contains info necessary to handle the data sources. |
protected int |
kind
See valueProvider |
protected long |
lastIndex
|
protected byte |
maxByte
|
protected double |
maxDouble
|
protected float |
maxFloat
|
protected int |
maxInteger
|
protected long |
maxLong
|
protected java.lang.Object |
maxObject
|
protected short |
maxShort
|
protected byte |
minByte
|
protected double |
minDouble
|
protected float |
minFloat
|
protected int |
minInteger
|
protected long |
minLong
|
protected java.lang.Object |
minObject
|
protected short |
minShort
|
Fields inherited from class simtools.data.DataSource |
---|
endNotificationListeners, listeners, sortedOrder |
Fields inherited from class simtools.data.ValueProvider |
---|
ByteProvider, DoubleProvider, FloatProvider, IntegerProvider, LongProvider, ObjectProvider, ShortProvider |
Constructor Summary | |
---|---|
DynamicDataSource(DataInfo di,
int kind)
Builds a new dynamic data source with the given data information. |
|
DynamicDataSource(DataInfo di,
int kind,
int delay)
Builds a new dynamic data source with the given data information, and backed by a data buffer of the given size |
Method Summary | |
---|---|
void |
bufferize(int delay)
Adds a buffer to this source so it can keep previous values in memory |
protected void |
changeInfo(DataInfo di)
Change our own information. |
long |
computeLastIndex()
|
boolean |
computeMinMax()
Compute the min and the max of this data source |
long |
computeStartIndex()
|
byte |
getByteMax()
|
byte |
getByteMin()
|
double |
getDoubleMax()
|
double |
getDoubleMin()
|
float |
getFloatMax()
|
float |
getFloatMin()
|
DataInfo |
getInformation()
|
int |
getIntegerMax()
|
int |
getIntegerMin()
|
int |
getKind()
The kind of this provider may be used fo optimization purpose. |
long |
getLastIndex()
|
long |
getLongMax()
|
long |
getLongMin()
|
java.lang.Object |
getMax()
|
java.lang.Object |
getMin()
Other functions have a reasonable default implementation |
short |
getShortMax()
|
short |
getShortMin()
|
long |
getStartIndex()
|
java.lang.Object |
getValue(long index)
|
boolean |
isAutoRegister()
|
boolean |
isComparable(int i)
|
protected void |
registerNewValue()
Call this function once you have set up all the values with setValue. |
void |
setAutoRegister(boolean autoRegister)
|
protected void |
setByteValue(byte v)
Sets the value of this Datasource to the byte v |
protected void |
setDoubleValue(double v)
Sets the value of this Datasource to the double v |
protected void |
setFloatValue(float v)
Sets the value of this Datasource to the float v |
protected void |
setIntegerValue(int v)
Sets the value of this Datasource to the int v |
protected void |
setLongValue(long v)
Sets the value of this Datasource to the long v |
protected void |
setObjectValue(java.lang.Object v)
Sets the value of this Datasource to the Object v |
protected void |
setShortValue(short v)
Sets the value of this Datasource to the short v |
java.lang.Class |
valueClass()
Returns the more specialized superclass of all objects returned by this provider. |
Methods inherited from class simtools.data.ValueProvider |
---|
getByteValue, getDoubleValue, getFloatValue, getIntegerValue, getLongValue, getObjectValue, getShortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public DataInfo info
protected long lastIndex
protected boolean autoRegister
protected int kind
protected boolean hasValue
protected byte currentByte
protected byte cachedByte
protected byte minByte
protected byte maxByte
protected short currentShort
protected short cachedShort
protected short minShort
protected short maxShort
protected int currentInteger
protected int cachedInteger
protected int minInteger
protected int maxInteger
protected long currentLong
protected long cachedLong
protected long minLong
protected long maxLong
protected float currentFloat
protected float cachedFloat
protected float minFloat
protected float maxFloat
protected double currentDouble
protected double cachedDouble
protected double minDouble
protected double maxDouble
protected java.lang.Object currentObject
protected java.lang.Object cachedObject
protected java.lang.Object minObject
protected java.lang.Object maxObject
Constructor Detail |
---|
public DynamicDataSource(DataInfo di, int kind)
di
- the data information for this source (name, comment, unit...)kind
- the type of the data source. @see ValueProviderpublic DynamicDataSource(DataInfo di, int kind, int delay)
di
- the data information for this source (name, comment, unit...)kind
- the type of the data source. @see ValueProviderdelay
- the size of the buffer for past valuesMethod Detail |
---|
public void bufferize(int delay) throws UnsupportedOperation
UnsupportedOperation
public boolean isAutoRegister()
public void setAutoRegister(boolean autoRegister)
autoRegister
- The autoRegister to set.public java.lang.Object getMin() throws UnsupportedOperation
getMin
in class DataSource
UnsupportedOperation
public java.lang.Object getMax() throws UnsupportedOperation
getMax
in class DataSource
UnsupportedOperation
public byte getByteMin() throws DataException
getByteMin
in class DataSource
DataException
public byte getByteMax() throws DataException
getByteMax
in class DataSource
DataException
public short getShortMin() throws DataException
getShortMin
in class DataSource
DataException
public short getShortMax() throws DataException
getShortMax
in class DataSource
DataException
public int getIntegerMin() throws DataException
getIntegerMin
in class DataSource
DataException
public int getIntegerMax() throws DataException
getIntegerMax
in class DataSource
DataException
public long getLongMin() throws DataException
getLongMin
in class DataSource
DataException
public long getLongMax() throws DataException
getLongMax
in class DataSource
DataException
public float getFloatMin() throws DataException
getFloatMin
in class DataSource
DataException
public float getFloatMax() throws DataException
getFloatMax
in class DataSource
DataException
public double getDoubleMin() throws DataException
getDoubleMin
in class DataSource
DataException
public double getDoubleMax() throws DataException
getDoubleMax
in class DataSource
DataException
public boolean computeMinMax() throws UnsupportedOperation
UnsupportedOperation
public boolean isComparable(int i)
public long getStartIndex()
getStartIndex
in class DataSource
public long getLastIndex()
getLastIndex
in class DataSource
public long computeStartIndex()
computeStartIndex
in class DataSource
public long computeLastIndex()
computeLastIndex
in class DataSource
protected void changeInfo(DataInfo di)
protected void setByteValue(byte v)
v
- the byte value to setprotected void setShortValue(short v)
v
- the short value to setprotected void setIntegerValue(int v)
v
- the int value to setprotected void setLongValue(long v)
v
- the long value to setprotected void setFloatValue(float v)
v
- the float value to setprotected void setDoubleValue(double v)
v
- the double value to setprotected void setObjectValue(java.lang.Object v)
v
- the Object value to setprotected void registerNewValue()
dsnum
- v
- public DataInfo getInformation()
getInformation
in class DataSource
public java.lang.Object getValue(long index) throws DataException
getValue
in class ValueProvider
DataException
public int getKind()
ValueProvider
getKind
in class ValueProvider
public java.lang.Class valueClass()
ValueProvider
valueClass
in class ValueProvider
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |