|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
simtools.data.DataSourceCollection
public abstract class DataSourceCollection
A data source collection gathers data sources with strong interdependancy For example, all the data source values may be read from the same file. This strong inter-dependancy is highlighted by: - The delegation of CollectiveDataSource methods here - The same indexing system for all CollectiveDataSource - A common update mechanism. This is an abstract class. Default implementation handles indexing and update mechanism, but subclasses are responsible for handling values together with setting the index corresponding to those values. Two sets of methods are provided: one uses CollectiveDataSource parameters and the other uses integer = position in the vector of the corresponding CollectiveDataSource. They are of course equivalent and the first calls the second. Thus, subclasses should only implement methods with the vector-like API, not the ones with the CollectiveDataSource parameters.
Nested Class Summary | |
---|---|
class |
DataSourceCollection.Container
|
Field Summary | |
---|---|
protected Buffer[] |
buffers
|
protected ListenerManager |
endNotificationListeners
|
protected long |
lastIndex
|
protected ListenerManager |
listeners
|
protected java.util.HashMap |
map
to get quickly the StreamingDataSource in the vector according to its name |
protected long |
startIndex
|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
DataSourceCollection()
|
Method Summary | |
---|---|
void |
addEndNotificationListener(EndNotificationListener enl)
|
void |
addListener(DataSourceCollectionListener dscl)
|
void |
attachBuffer(int i,
Buffer b)
Internal method for the buffer package only, could lead to inconsistencies if misused. |
void |
bufferize(Buffer b)
Public method to put a buffer on a data source |
void |
bufferize(int i)
Public method to put a buffer on a data source. |
void |
bufferize(int i,
Buffer b)
Public method to put a buffer on a data source |
long |
computeLastIndex()
|
long |
computeLastIndex(int i)
|
java.lang.Object |
computeMax(int i)
|
java.lang.Object |
computeMin(int i)
|
long |
computeStartIndex()
|
long |
computeStartIndex(int i)
|
DataSource |
get(java.lang.String id)
|
byte |
getByteMax(int i)
|
byte |
getByteMin(int i)
|
byte |
getByteValue(int i,
long index)
Optimized accessor for byte values. |
java.util.Collection |
getCollectionContainers()
If the data source collection is compound return the first level collection of containers used to organize the data sources |
double |
getDoubleMax(int i)
|
double |
getDoubleMin(int i)
|
double |
getDoubleValue(int i,
long index)
Optimized accessor for double values. |
float |
getFloatMax(int i)
|
float |
getFloatMin(int i)
|
float |
getFloatValue(int i,
long index)
Optimized accessor for float values. |
DataInfo |
getInformation()
|
DataInfo |
getInformation(int i)
|
int |
getIntegerMax(int i)
|
int |
getIntegerMin(int i)
|
int |
getIntegerValue(int i,
long index)
Optimized accessor for int values. |
int |
getKind(int i)
Kind of the data source at position i, Object by default |
long |
getLastIndex()
|
long |
getLastIndex(int i)
|
long |
getLongMax(int i)
|
long |
getLongMin(int i)
|
long |
getLongValue(int i,
long index)
Optimized accessor for long values. |
java.lang.Object |
getMax(int i)
|
java.lang.Object |
getMin(int i)
|
short |
getShortMax(int i)
|
short |
getShortMin(int i)
|
short |
getShortValue(int i,
long index)
Optimized accessor for short values. |
long |
getStartIndex()
Common indexation system for all members of this collection |
long |
getStartIndex(int i)
|
abstract java.lang.Object |
getValue(int i,
long index)
Methods for subclasses to specialize |
int |
hashCode()
Overrides Vector/AbstractList implementation to get a fix hashcode and be able to put and remove a collection from a HashSet for instance |
boolean |
isComparable(int i)
|
boolean |
isCompound()
Checks if a data source collection is compound, i.e. if it provides containers to organize the data source hierarchically |
void |
notifyEndNotificationListeners()
Use this method only when this data source collection is the referer. |
protected void |
notifyListenersForCollectionRemoved()
|
protected void |
notifyListenersForDataSourceAdded(DataSource ds)
|
protected void |
notifyListenersForDataSourceRemoved(DataSource ds)
|
void |
notifyListenersForInfoChange(DataInfo newInfo)
|
void |
removeAllElements()
|
void |
removeEndNotificationListener(EndNotificationListener enl)
|
void |
removeListener(DataSourceCollectionListener dscl)
|
void |
setSlice(long min,
long max)
|
int |
sortedOrder(int i)
|
java.lang.Class |
valueClass(int i)
Returns the more specialized superclass of all objects returned by the i-th data source. |
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 |
---|
protected ListenerManager listeners
protected ListenerManager endNotificationListeners
protected long startIndex
protected long lastIndex
protected Buffer[] buffers
protected java.util.HashMap map
Constructor Detail |
---|
public DataSourceCollection()
Method Detail |
---|
public long getStartIndex() throws UnsupportedOperation
UnsupportedOperation
public long getLastIndex() throws UnsupportedOperation
UnsupportedOperation
public long computeStartIndex() throws UnsupportedOperation
UnsupportedOperation
public long computeLastIndex() throws UnsupportedOperation
UnsupportedOperation
public long getStartIndex(int i) throws UnsupportedOperation
UnsupportedOperation
public long getLastIndex(int i) throws UnsupportedOperation
UnsupportedOperation
public long computeStartIndex(int i) throws UnsupportedOperation
UnsupportedOperation
public long computeLastIndex(int i) throws UnsupportedOperation
UnsupportedOperation
public void setSlice(long min, long max)
public DataInfo getInformation()
public int getKind(int i)
public java.lang.Class valueClass(int i)
public DataSource get(java.lang.String id)
id
-
public void attachBuffer(int i, Buffer b)
public void bufferize(int i) throws UnsupportedOperation
i
- The position of the datasource to bufferize
UnsupportedOperation
public void bufferize(int i, Buffer b) throws UnsupportedOperation
i
- The position of the datasource to bufferizeb
- The buffer to use. It must have been created using the
datasource at position i, or a null provider (in which case,
the datasource at position i will be used automatically). An
UnsupportedOperation exception is thrown otherwise.
UnsupportedOperation
public void bufferize(Buffer b) throws UnsupportedOperation
b
- The buffer to use. It must have been created using a null
provider. The buffer will then be cloned and applied to all
datasources using the bufferize(int,Buffer) function.
UnsupportedOperation
public abstract java.lang.Object getValue(int i, long index) throws DataException
DataException
public byte getByteValue(int i, long index) throws DataException
DataException
public short getShortValue(int i, long index) throws DataException
DataException
public int getIntegerValue(int i, long index) throws DataException
DataException
public long getLongValue(int i, long index) throws DataException
DataException
public float getFloatValue(int i, long index) throws DataException
DataException
public double getDoubleValue(int i, long index) throws DataException
DataException
public DataInfo getInformation(int i)
public java.lang.Object getMin(int i) throws UnsupportedOperation
UnsupportedOperation
public java.lang.Object getMax(int i) throws UnsupportedOperation
UnsupportedOperation
public byte getByteMin(int i) throws DataException
DataException
public byte getByteMax(int i) throws DataException
DataException
public short getShortMin(int i) throws DataException
DataException
public short getShortMax(int i) throws DataException
DataException
public int getIntegerMin(int i) throws DataException
DataException
public int getIntegerMax(int i) throws DataException
DataException
public long getLongMin(int i) throws DataException
DataException
public long getLongMax(int i) throws DataException
DataException
public float getFloatMin(int i) throws DataException
DataException
public float getFloatMax(int i) throws DataException
DataException
public double getDoubleMin(int i) throws DataException
DataException
public double getDoubleMax(int i) throws DataException
DataException
public java.lang.Object computeMin(int i) throws UnsupportedOperation
UnsupportedOperation
public java.lang.Object computeMax(int i) throws UnsupportedOperation
UnsupportedOperation
public int sortedOrder(int i)
public boolean isComparable(int i)
public void addListener(DataSourceCollectionListener dscl)
public void removeListener(DataSourceCollectionListener dscl)
public void addEndNotificationListener(EndNotificationListener enl)
public void removeEndNotificationListener(EndNotificationListener enl)
public void notifyListenersForInfoChange(DataInfo newInfo)
protected void notifyListenersForDataSourceAdded(DataSource ds)
protected void notifyListenersForDataSourceRemoved(DataSource ds)
protected void notifyListenersForCollectionRemoved()
public void removeAllElements()
removeAllElements
in class java.util.Vector
public void notifyEndNotificationListeners()
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.List
hashCode
in class java.util.Vector
public boolean isCompound()
public java.util.Collection getCollectionContainers()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |