simtools.data
Class SinusSource

java.lang.Object
  extended by simtools.data.ValueProvider
      extended by simtools.data.DataSource
          extended by simtools.data.SinusSource
All Implemented Interfaces:
java.io.Serializable

public class SinusSource
extends DataSource
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  double _amplitude
           
protected  long _end
           
protected  double _freq
           
protected  double _ofst
           
protected  double _phase
           
protected  long _start
           
 
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
SinusSource(double freq, double phase, double amplitude, double ofst, long start, long end)
           
 
Method Summary
 long computeLastIndex()
           
 java.lang.Object computeMax()
           
 java.lang.Object computeMin()
          Force the computation if possible.
 long computeStartIndex()
           
 double getDoubleValue(long index)
          Optimize for double access getValue calls this function and wraps a Double around
 DataInfo getInformation()
           
 long getLastIndex()
           
 java.lang.Object getMax()
           
 java.lang.Object getMin()
          Return values if possibly only, without expensive computations.
 long getStartIndex()
           
 java.lang.Object getValue(long index)
           
 void setSlice(long min, long max)
          Sets a region of interest in the DataSource.
 int sortedOrder()
          Check if the values are sorted or not.
 void update()
           
 java.lang.Class valueClass()
          Returns the more specialized superclass of all objects returned by this provider.
 
Methods inherited from class simtools.data.DataSource
addEndNotificationListener, addListener, computeSortedOrder, createEmptyDataSource, equals, getAuxiliarySources, getByteMax, getByteMin, getChoiceFormat, getDataSourceInformationClass, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getIntegerMax, getIntegerMin, getLongMax, getLongMin, getShortMax, getShortMin, getSortedOrder, getSourceDependencies, isAuxiliary, isComparable, isCompound, notifyEndNotificationListeners, notifyListenersForDataReplaced, notifyListenersForDataReplaced, notifyListenersForIndexRangeChange, notifyListenersForInfoChange, notifyListenersForOrderChange, notifyListenersForValueChange, notifyListenersForValueRangeChange, removeEndNotificationListener, removeListener, updateSortedOrder
 
Methods inherited from class simtools.data.ValueProvider
getByteValue, getFloatValue, getIntegerValue, getKind, getLongValue, getObjectValue, getShortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_freq

protected double _freq

_phase

protected double _phase

_amplitude

protected double _amplitude

_ofst

protected double _ofst

_start

protected long _start

_end

protected long _end
Constructor Detail

SinusSource

public SinusSource(double freq,
                   double phase,
                   double amplitude,
                   double ofst,
                   long start,
                   long end)
Method Detail

getInformation

public DataInfo getInformation()
Overrides:
getInformation in class DataSource

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

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

computeMin

public java.lang.Object computeMin()
                            throws UnsupportedOperation
Force the computation if possible. The operation may take some time.

Overrides:
computeMin in class DataSource
Throws:
UnsupportedOperation

computeMax

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

computeStartIndex

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

computeLastIndex

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

setSlice

public void setSlice(long min,
                     long max)
Description copied from class: DataSource
Sets a region of interest in the DataSource. This is a purely informative function, but the DataSource may use this information to optimize itself on this specific range.

Overrides:
setSlice in class DataSource

getDoubleValue

public double getDoubleValue(long index)
Optimize for double access getValue calls this function and wraps a Double around

Overrides:
getDoubleValue in class ValueProvider

getValue

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

valueClass

public java.lang.Class valueClass()
Description copied from class: ValueProvider
Returns the more specialized superclass of all objects returned by this provider. Returns Object by default in the base implementation, subclass should specialize if possible.

Overrides:
valueClass in class ValueProvider

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

update

public void update()
            throws UnsupportedOperation
Throws:
UnsupportedOperation