simtools.data.async
Class TimeStampedDataSource.TimeSource

java.lang.Object
  extended by simtools.data.ValueProvider
      extended by simtools.data.DataSource
          extended by simtools.data.async.TimeStampedDataSource.TimeSource
Direct Known Subclasses:
AsynchronousMergeDSCollection.AsynchronousMergeDataSource.RefTime, StreamingTSDataSource.StreamingTimeSource, TimeStampedEmptyDataSource.TimeSourceEmpty
Enclosing class:
TimeStampedDataSource

public abstract class TimeStampedDataSource.TimeSource
extends DataSource


Field Summary
protected  DataInfo info
           
 
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
TimeStampedDataSource.TimeSource()
           
TimeStampedDataSource.TimeSource(java.lang.String name)
           
 
Method Summary
abstract  double getDoubleValue(long index)
          Optimized accessor for double values.
 DataInfo getInformation()
           
 long getLastIndex()
           
 java.lang.Object getMax()
           
 java.lang.Object getMin()
          Return values if possibly only, without expensive computations.
 long getStartIndex()
           
abstract  java.lang.Object getValue(long index)
           
 boolean isAuxiliary()
           
 int sortedOrder()
          Check if the values are sorted or not.
 
Methods inherited from class simtools.data.DataSource
addEndNotificationListener, addListener, computeLastIndex, computeMax, computeMin, computeSortedOrder, computeStartIndex, createEmptyDataSource, equals, getAuxiliarySources, getByteMax, getByteMin, getChoiceFormat, getDataSourceInformationClass, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getIntegerMax, getIntegerMin, getLongMax, getLongMin, getShortMax, getShortMin, getSortedOrder, getSourceDependencies, isComparable, isCompound, notifyEndNotificationListeners, notifyListenersForDataReplaced, notifyListenersForDataReplaced, notifyListenersForIndexRangeChange, notifyListenersForInfoChange, notifyListenersForOrderChange, notifyListenersForValueChange, notifyListenersForValueRangeChange, removeEndNotificationListener, removeListener, setSlice, updateSortedOrder
 
Methods inherited from class simtools.data.ValueProvider
getByteValue, getFloatValue, getIntegerValue, getKind, getLongValue, getObjectValue, getShortValue, valueClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected DataInfo info
Constructor Detail

TimeStampedDataSource.TimeSource

public TimeStampedDataSource.TimeSource(java.lang.String name)

TimeStampedDataSource.TimeSource

public TimeStampedDataSource.TimeSource()
Method Detail

getValue

public abstract java.lang.Object getValue(long index)
                                   throws DataException
Specified by:
getValue in class ValueProvider
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.

Overrides:
getDoubleValue in class ValueProvider
Throws:
DataException

getStartIndex

public long getStartIndex()
                   throws UnsupportedOperation
Overrides:
getStartIndex in class DataSource
Throws:
UnsupportedOperation

getLastIndex

public long getLastIndex()
                  throws UnsupportedOperation
Overrides:
getLastIndex in class DataSource
Throws:
UnsupportedOperation

getMin

public java.lang.Object getMin()
                        throws UnsupportedOperation
Description copied from class: DataSource
Return values if possibly only, without expensive computations.

Overrides:
getMin in class DataSource
Throws:
UnsupportedOperation

getMax

public java.lang.Object getMax()
                        throws UnsupportedOperation
Overrides:
getMax in class DataSource
Throws:
UnsupportedOperation

sortedOrder

public int sortedOrder()
Description copied from class: DataSource
Check if the values are sorted or not. This is usefull to optimize some computations (curves drawing for instance)

Overrides:
sortedOrder in class DataSource
Returns:
0 if the values are not sorted, 1 if the values are sorted in ascending order and -1 if the values are sorted in descending order

getInformation

public DataInfo getInformation()
Overrides:
getInformation in class DataSource

isAuxiliary

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