simtools.data.merge
Class SynchronousMergeDSCollection.DirectSynchronousMergedDataSource

java.lang.Object
  extended by simtools.data.ValueProvider
      extended by simtools.data.DataSource
          extended by simtools.data.CollectiveDataSource
              extended by simtools.data.merge.SynchronousMergeDSCollection.DirectSynchronousMergedDataSource
Enclosing class:
SynchronousMergeDSCollection

public class SynchronousMergeDSCollection.DirectSynchronousMergedDataSource
extends CollectiveDataSource

A data source dedicated to manage aperiodical data sources.

Author:
zxpletran007

Field Summary
protected  DataInfo info
           
protected  DataSource source
           
protected  DataSource timeRef
           
 
Fields inherited from class simtools.data.CollectiveDataSource
collection, myIndex
 
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
protected SynchronousMergeDSCollection.DirectSynchronousMergedDataSource(java.lang.String name, DataSourceCollection c, int i, DataSource source, DataSource timeSource, boolean isRelative, double offset, double initialDate)
           
 
Method Summary
 java.lang.Object computeMax()
           
 java.lang.Object computeMin()
          Force the computation if possible.
 double getDoubleMax()
           
 double getDoubleMin()
           
 double getDoubleValue(long index)
          Optimized accessor for double values.
 DataInfo getInformation()
          These methods are common to the whole collection
 java.lang.Object getMax()
           
 java.lang.Object getMin()
          Return values if possibly only, without expensive computations.
 java.lang.Object getObjectValue(long index)
          Naming compatibility function.
protected  double getTimeDoubleValue(long index)
          Compute time value for specified index.
 java.lang.Object getValue(long index)
           
protected  void setInfo(java.lang.String name)
           
 int sortedOrder()
          Check if the values are sorted or not.
 void updateDirectBuffer()
          Interpolate source values in order to fit with collection time reference.
 
Methods inherited from class simtools.data.CollectiveDataSource
addEndNotificationListener, computeLastIndex, computeStartIndex, createEmptyDataSource, getByteMax, getByteMin, getByteValue, getCollection, getFloatMax, getFloatMin, getFloatValue, getIntegerMax, getIntegerMin, getIntegerValue, getKind, getLastIndex, getLongMax, getLongMin, getLongValue, getPosition, getShortMax, getShortMin, getShortValue, getStartIndex, isComparable, notifyEndNotificationListeners, removeEndNotificationListener, setSlice
 
Methods inherited from class simtools.data.DataSource
addListener, computeSortedOrder, equals, getAuxiliarySources, getChoiceFormat, getDataSourceInformationClass, getSortedOrder, getSourceDependencies, isAuxiliary, isCompound, notifyListenersForDataReplaced, notifyListenersForDataReplaced, notifyListenersForIndexRangeChange, notifyListenersForInfoChange, notifyListenersForOrderChange, notifyListenersForValueChange, notifyListenersForValueRangeChange, removeListener, updateSortedOrder
 
Methods inherited from class simtools.data.ValueProvider
valueClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected DataInfo info

source

protected DataSource source

timeRef

protected DataSource timeRef
Constructor Detail

SynchronousMergeDSCollection.DirectSynchronousMergedDataSource

protected SynchronousMergeDSCollection.DirectSynchronousMergedDataSource(java.lang.String name,
                                                                         DataSourceCollection c,
                                                                         int i,
                                                                         DataSource source,
                                                                         DataSource timeSource,
                                                                         boolean isRelative,
                                                                         double offset,
                                                                         double initialDate)
Method Detail

updateDirectBuffer

public void updateDirectBuffer()
                        throws DataException,
                               java.lang.OutOfMemoryError
Interpolate source values in order to fit with collection time reference. _values _min, _max are updated.

Throws:
DataException
java.lang.OutOfMemoryError

getTimeDoubleValue

protected double getTimeDoubleValue(long index)
                             throws DataException
Compute time value for specified index.

Parameters:
index -
Returns:
corresponding time value for specified index.
Throws:
DataException

computeMax

public java.lang.Object computeMax()
                            throws UnsupportedOperation
Overrides:
computeMax in class CollectiveDataSource
Throws:
UnsupportedOperation

computeMin

public java.lang.Object computeMin()
                            throws UnsupportedOperation
Description copied from class: CollectiveDataSource
Force the computation if possible. The operation may take some time.

Overrides:
computeMin in class CollectiveDataSource
Throws:
UnsupportedOperation

getMax

public java.lang.Object getMax()
                        throws UnsupportedOperation
Overrides:
getMax in class CollectiveDataSource
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 CollectiveDataSource
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 CollectiveDataSource
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()
Description copied from class: CollectiveDataSource
These methods are common to the whole collection

Overrides:
getInformation in class CollectiveDataSource

setInfo

protected void setInfo(java.lang.String name)

getObjectValue

public java.lang.Object getObjectValue(long index)
                                throws DataException
Description copied from class: ValueProvider
Naming compatibility function. Calls getValue()

Overrides:
getObjectValue in class ValueProvider
Throws:
DataException

getDoubleValue

public 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 CollectiveDataSource
Throws:
DataException

getValue

public java.lang.Object getValue(long index)
                          throws DataException
Overrides:
getValue in class CollectiveDataSource
Throws:
DataException

getDoubleMax

public double getDoubleMax()
                    throws DataException
Overrides:
getDoubleMax in class CollectiveDataSource
Throws:
DataException

getDoubleMin

public double getDoubleMin()
                    throws DataException
Overrides:
getDoubleMin in class CollectiveDataSource
Throws:
DataException