simtools.data.async
Class AsynchronousMergeDSCollection

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by simtools.data.DataSourceCollection
                  extended by simtools.data.async.TimeStampedDataSourceCollection
                      extended by simtools.data.async.AsynchronousMergeDSCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, MergeDSCollection
Direct Known Subclasses:
JSAsynchronousMergeDSCollection

public class AsynchronousMergeDSCollection
extends TimeStampedDataSourceCollection
implements MergeDSCollection

Merge data in a asynchronous way. each member of AsynchronousMergeDSCollection is stamped with a time data.

Author:
zxpletran007
See Also:
Serialized Form

Nested Class Summary
 class AsynchronousMergeDSCollection.AsynchronousMergeDataSource
           
 class AsynchronousMergeDSCollection.MergedCollectionContainer
           
 
Nested classes/interfaces inherited from class simtools.data.async.TimeStampedDataSourceCollection
TimeStampedDataSourceCollection.InvalidFormatException
 
Nested classes/interfaces inherited from class simtools.data.DataSourceCollection
DataSourceCollection.Container
 
Field Summary
protected static java.util.logging.Logger _logger
          A looger to dump error or warning messages in a soket, an output stream, a file...
protected  java.lang.String collectionName
           
protected  AsynchronousMergeDSCollection.MergedCollectionContainer collectionRoot
           
protected static int HUGEREPERTORYSIZE
           
static java.lang.String ID_MARKER
           
 
Fields inherited from class simtools.data.async.TimeStampedDataSourceCollection
_container, _end, _start, ID_DATE_FORMAT, timeStampedDateFormat
 
Fields inherited from class simtools.data.DataSourceCollection
buffers, endNotificationListeners, lastIndex, listeners, map, startIndex
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AsynchronousMergeDSCollection(java.lang.String collectionName)
           
 
Method Summary
 void add(DataSourceCollection dsc, DataSource timeRef, boolean isRelative, double offset, double initialDate)
          Merge a synchronous collection to the mergeDSCollection.
 void add(DataSource ds, DataSource timeRef, boolean isRelative, double offset, double initialDate)
          Merge a synchronous data to the mergeDSCollection.
 void add(TimeStampedDataSourceCollection tsdsc, double offset, double initialDate)
          Merge a time stamped collection to the mergeDSCollection
 void add(TimeStampedDataSource ds, double offset, double initialDate)
          Merge a time stamped data to the mergeDSCollection
 java.util.Collection getCollectionContainers()
          If the data source collection is compound return the first level collection of containers used to organize the data sources
 java.lang.String getCollectionName()
           
protected  AsynchronousMergeDSCollection.MergedCollectionContainer getDataSourceNode(java.lang.String name)
          Get the container where data source can be added
 double getDoubleValue(int i, long index)
          Optimized accessor for double values.
 DataInfo getInformation()
           
 java.lang.Object getValue(int i, long index)
          Methods for subclasses to specialize
 boolean isCompound()
          Checks if a data source collection is compound, i.e. if it provides containers to organize the data source hierarchically
protected  void sortHugeRepertories()
           
protected  void sortHugeRepertory(AsynchronousMergeDSCollection.MergedCollectionContainer repertory, int proof)
           
 
Methods inherited from class simtools.data.async.TimeStampedDataSourceCollection
computeMax, computeMin, getEnd, getInformation, getMax, getMin, getStart, setEnd, setStart, valueClass
 
Methods inherited from class simtools.data.DataSourceCollection
addEndNotificationListener, addListener, attachBuffer, bufferize, bufferize, bufferize, computeLastIndex, computeLastIndex, computeStartIndex, computeStartIndex, get, getByteMax, getByteMin, getByteValue, getDoubleMax, getDoubleMin, getFloatMax, getFloatMin, getFloatValue, getIntegerMax, getIntegerMin, getIntegerValue, getKind, getLastIndex, getLastIndex, getLongMax, getLongMin, getLongValue, getShortMax, getShortMin, getShortValue, getStartIndex, getStartIndex, hashCode, isComparable, notifyEndNotificationListeners, notifyListenersForCollectionRemoved, notifyListenersForDataSourceAdded, notifyListenersForDataSourceRemoved, notifyListenersForInfoChange, removeAllElements, removeEndNotificationListener, removeListener, setSlice, sortedOrder
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

_logger

protected static java.util.logging.Logger _logger
A looger to dump error or warning messages in a soket, an output stream, a file...


ID_MARKER

public static final java.lang.String ID_MARKER
See Also:
Constant Field Values

HUGEREPERTORYSIZE

protected static final int HUGEREPERTORYSIZE
See Also:
Constant Field Values

collectionRoot

protected AsynchronousMergeDSCollection.MergedCollectionContainer collectionRoot

collectionName

protected java.lang.String collectionName
Constructor Detail

AsynchronousMergeDSCollection

public AsynchronousMergeDSCollection(java.lang.String collectionName)
                              throws java.io.IOException,
                                     TimeStampedDataSourceCollection.InvalidFormatException
Throws:
java.io.IOException
TimeStampedDataSourceCollection.InvalidFormatException
Method Detail

getValue

public java.lang.Object getValue(int i,
                                 long index)
                          throws DataException
Description copied from class: DataSourceCollection
Methods for subclasses to specialize

Specified by:
getValue in class TimeStampedDataSourceCollection
Throws:
DataException

getDoubleValue

public double getDoubleValue(int i,
                             long index)
                      throws DataException
Description copied from class: DataSourceCollection
Optimized accessor for double values. Works the same way as provider functions.

Specified by:
getDoubleValue in class TimeStampedDataSourceCollection
Throws:
DataException

getInformation

public DataInfo getInformation()
Specified by:
getInformation in class TimeStampedDataSourceCollection

getCollectionName

public java.lang.String getCollectionName()

add

public void add(TimeStampedDataSourceCollection tsdsc,
                double offset,
                double initialDate)
         throws MergeDataException
Description copied from interface: MergeDSCollection
Merge a time stamped collection to the mergeDSCollection

Specified by:
add in interface MergeDSCollection
initialDate - An initial absolute date for relative <-> absolute consersion
Throws:
MergeDataException

add

public void add(TimeStampedDataSource ds,
                double offset,
                double initialDate)
         throws MergeDataException
Description copied from interface: MergeDSCollection
Merge a time stamped data to the mergeDSCollection

Specified by:
add in interface MergeDSCollection
initialDate - An initial absolute date for relative <-> absolute consersion
Throws:
MergeDataException

add

public void add(DataSourceCollection dsc,
                DataSource timeRef,
                boolean isRelative,
                double offset,
                double initialDate)
         throws MergeDataException
Description copied from interface: MergeDSCollection
Merge a synchronous collection to the mergeDSCollection.

Specified by:
add in interface MergeDSCollection
timeRef - true is timeRef is expressed with relative time.
initialDate - An initial absolute date for relative <-> absolute consersion
Throws:
MergeDataException

add

public void add(DataSource ds,
                DataSource timeRef,
                boolean isRelative,
                double offset,
                double initialDate)
         throws MergeDataException
Description copied from interface: MergeDSCollection
Merge a synchronous data to the mergeDSCollection.

Specified by:
add in interface MergeDSCollection
isRelative - true is timeRef is expressed with relative time.
initialDate - An initial absolute date for relative <-> absolute consersion
Throws:
MergeDataException

isCompound

public boolean isCompound()
Description copied from class: DataSourceCollection
Checks if a data source collection is compound, i.e. if it provides containers to organize the data source hierarchically

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

getCollectionContainers

public java.util.Collection getCollectionContainers()
Description copied from class: DataSourceCollection
If the data source collection is compound return the first level collection of containers used to organize the data sources

Overrides:
getCollectionContainers in class TimeStampedDataSourceCollection
Returns:
the first level collection of containers or null

getDataSourceNode

protected AsynchronousMergeDSCollection.MergedCollectionContainer getDataSourceNode(java.lang.String name)
Get the container where data source can be added

Parameters:
name. - data source name
Returns:
(OCContainer).The container where data source can be added

sortHugeRepertories

protected void sortHugeRepertories()

sortHugeRepertory

protected void sortHugeRepertory(AsynchronousMergeDSCollection.MergedCollectionContainer repertory,
                                 int proof)
Parameters:
repertory - , where data source have to be structured
proof, - number of prefixes to remove from all data sources names, in order to compute the new structure. Ex : if PL.TM.variable -> proof = 2