simtools.data.async
Class MultiStampedDataSource.IntegerSource

java.lang.Object
  extended by simtools.data.ValueProvider
      extended by simtools.data.DataSource
          extended by simtools.data.async.TimeStampedDataSource
              extended by simtools.data.async.MultiStampedDataSource.IntegerSource
Enclosing class:
MultiStampedDataSource

public abstract class MultiStampedDataSource.IntegerSource
extends TimeStampedDataSource


Nested Class Summary
 
Nested classes/interfaces inherited from class simtools.data.async.TimeStampedDataSource
TimeStampedDataSource.TimeSource
 
Field Summary
protected  java.lang.String type
           
 
Fields inherited from class simtools.data.async.TimeStampedDataSource
_auxiliaries
 
Fields inherited from class simtools.data.DataSource
endNotificationListeners, listeners, sortedOrder
 
Fields inherited from class simtools.data.ValueProvider
ByteProvider, DoubleProvider, FloatProvider, IntegerProvider, kind, LongProvider, ObjectProvider, ShortProvider
 
Constructor Summary
MultiStampedDataSource.IntegerSource(java.lang.String type)
           
 
Method Summary
protected  void computeMinMax()
           
 java.util.Collection getAuxiliarySources()
          If the data source is compund return the collection of auxiliary data sources
 java.text.ChoiceFormat getChoiceFormat()
          This method allows you to attach a format to data source values
abstract  double getDoubleValue(long index)
          Optimized accessor for double values.
 double getEnd()
           
 long getLastIndex()
           
abstract  long getLongValue(long index)
          Optimized accessor for long values.
 double getStart()
           
 long getStartIndex()
           
abstract  java.lang.Object getValue(long index)
           
 boolean isAuxiliary()
           
 boolean isCompound()
          Checks if a data source is compound, i.e. if it provides auxiliary data sources
 boolean isValid()
           
 
Methods inherited from class simtools.data.async.TimeStampedDataSource
createEmptyDataSource, getCollection, getDataSourceInformationClass, getDoubleMax, getDoubleMin, getInfo, getInformation, getMax, getMin, getName, getTime, setInfo, setMax, setMin, setMinmax, setTime, toString
 
Methods inherited from class simtools.data.DataSource
addEndNotificationListener, addListener, computeLastIndex, computeMax, computeMin, computeSortedOrder, computeStartIndex, equals, getByteMax, getByteMin, getFloatMax, getFloatMin, getIntegerMax, getIntegerMin, getLongMax, getLongMin, getShortMax, getShortMin, getSortedOrder, getSourceDependencies, isComparable, notifyEndNotificationListeners, notifyListenersForDataReplaced, notifyListenersForDataReplaced, notifyListenersForIndexRangeChange, notifyListenersForInfoChange, notifyListenersForOrderChange, notifyListenersForValueChange, notifyListenersForValueRangeChange, removeEndNotificationListener, removeListener, setSlice, sortedOrder, updateSortedOrder
 
Methods inherited from class simtools.data.ValueProvider
getByteValue, getFloatValue, getIntegerValue, getKind, getObjectValue, getShortValue, valueClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected java.lang.String type
Constructor Detail

MultiStampedDataSource.IntegerSource

public MultiStampedDataSource.IntegerSource(java.lang.String type)
                                     throws java.io.IOException,
                                            TimeStampedDataSourceCollection.InvalidFormatException
Throws:
java.io.IOException
TimeStampedDataSourceCollection.InvalidFormatException
Method Detail

getValue

public abstract java.lang.Object getValue(long index)
                                   throws DataException
Specified by:
getValue in class TimeStampedDataSource
Throws:
DataException

getDoubleValue

public abstract double getDoubleValue(long index)
                               throws DataException
Description copied from class: ValueProvider
Optimized accessor for double values. If the provider can provide doubles directly, then it should override this method. Otherwise, the default implementation will do its best to convert the Object returned by getValue() to a double. This conversion also parses strings, and returns 0 if it failed. An exception is thrown if, and only if, getValue throws it.

Specified by:
getDoubleValue in class TimeStampedDataSource
Throws:
DataException

getLongValue

public abstract long getLongValue(long index)
                           throws DataException
Description copied from class: ValueProvider
Optimized accessor for long values. If the provider can provide longs directly, then it should override this method. Otherwise, the default implementation will do its best to convert the Object returned by getValue() to a long. This conversion also parses strings, and returns 0 if it failed. An exception is thrown if, and only if, getValue throws it.

Overrides:
getLongValue in class ValueProvider
Throws:
DataException

getStartIndex

public long getStartIndex()
                   throws UnsupportedOperation
Specified by:
getStartIndex in class TimeStampedDataSource
Throws:
UnsupportedOperation

getLastIndex

public long getLastIndex()
                  throws UnsupportedOperation
Specified by:
getLastIndex in class TimeStampedDataSource
Throws:
UnsupportedOperation

getStart

public double getStart()
                throws DataException
Specified by:
getStart in class TimeStampedDataSource
Throws:
DataException

getEnd

public double getEnd()
              throws DataException
Specified by:
getEnd in class TimeStampedDataSource
Throws:
DataException

computeMinMax

protected void computeMinMax()
                      throws UnsupportedOperation
Specified by:
computeMinMax in class TimeStampedDataSource
Throws:
UnsupportedOperation

getAuxiliarySources

public java.util.Collection getAuxiliarySources()
Description copied from class: DataSource
If the data source is compund return the collection of auxiliary data sources

Overrides:
getAuxiliarySources in class TimeStampedDataSource
Returns:
the auxilary data source collection or null if not a compound data source

getChoiceFormat

public java.text.ChoiceFormat getChoiceFormat()
Description copied from class: DataSource
This method allows you to attach a format to data source values

Overrides:
getChoiceFormat in class DataSource
Returns:
datasource choiceformat

isCompound

public boolean isCompound()
Description copied from class: DataSource
Checks if a data source is compound, i.e. if it provides auxiliary data sources

Overrides:
isCompound in class TimeStampedDataSource
Returns:
true if it is compound

isValid

public boolean isValid()
Specified by:
isValid in class TimeStampedDataSource
Returns:
true if it is valid

isAuxiliary

public boolean isAuxiliary()
Overrides:
isAuxiliary in class DataSource
Returns:
true if the data source is an auxiliary data source