|
|||||||||
| 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
simtools.data.DynamicDataSourceCollection
simtools.data.DataSourceCollectionAnimator
public class DataSourceCollectionAnimator
This class adds dynamical features to a DataSourceCollection. This is useful to replay time series, for example. It will use the underlying collection to provide the values, and has its own API to control how to advance the index : step by step, or with a timer. Note: All APIs from superclasses are also redirected, including vector. Collective data sources are also redirect to us. So, this wrapper should really be transparent. This is especially important to understand the code behind buffer functions also works without overloading base functions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class simtools.data.DynamicDataSourceCollection |
|---|
DynamicDataSourceCollection.SourceInfo |
| Nested classes/interfaces inherited from class simtools.data.DataSourceCollection |
|---|
DataSourceCollection.Container |
| Field Summary | |
|---|---|
protected boolean |
autoStop
|
protected boolean |
finished
|
static java.lang.String |
MARKER
|
protected long |
period
|
protected DataSourceCollection |
target
|
protected java.util.Timer |
timer
|
| Fields inherited from class simtools.data.DynamicDataSourceCollection |
|---|
ourInfo, sourceInfo |
| 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 | |
|---|---|
DataSourceCollectionAnimator(DataSourceCollection dsc)
|
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addElement(java.lang.Object obj)
|
int |
capacity()
|
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object elem)
|
boolean |
containsAll(java.util.Collection c)
|
void |
copyInto(java.lang.Object[] anArray)
|
protected DataSource |
createDataSource(DataInfo info)
|
protected DataSource |
createDataSource(DataInfo info,
int kind)
Add a data source with the given info. |
void |
DataSourceCollectionDataSourceAdded(DataSourceCollection dsc,
DataSource ds)
Called when the information about the data source collection changed |
void |
DataSourceCollectionDataSourceRemoved(DataSourceCollection dsc,
DataSource ds)
Called when the information about the data source collection changed |
void |
DataSourceCollectionInfoChanged(DataSourceCollection dsc,
DataInfo newInfo)
Called when the information about the data source collection changed |
void |
DataSourceCollectionRemoved(DataSourceCollection dsc)
Called when the data source collection has been removed |
java.lang.Object |
elementAt(int index)
|
java.util.Enumeration |
elements()
|
void |
ensureCapacity(int minCapacity)
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
firstElement()
|
java.lang.Object |
get(int index)
|
DataSource |
get(java.lang.String id)
|
DataInfo |
getInformation()
|
long |
getPeriod()
|
DataSourceCollection |
getTargetCollection()
|
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 |
int |
indexOf(java.lang.Object elem)
|
int |
indexOf(java.lang.Object elem,
int index)
|
void |
insertElementAt(java.lang.Object obj,
int index)
|
boolean |
isAutoStop()
|
boolean |
isEmpty()
|
boolean |
isFinished()
|
boolean |
isRunning()
|
java.util.Iterator |
iterator()
|
java.lang.Object |
lastElement()
|
int |
lastIndexOf(java.lang.Object elem)
|
int |
lastIndexOf(java.lang.Object elem,
int index)
|
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int index)
|
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
void |
removeAllElements()
|
boolean |
removeElement(java.lang.Object obj)
|
void |
removeElementAt(int index)
|
void |
reset()
Resets the source. |
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int index,
java.lang.Object element)
|
void |
setAutoStop(boolean autoStop)
|
void |
setElementAt(java.lang.Object obj,
int index)
|
void |
setPeriod(long period)
Sets a period for cyclic execution |
void |
setSize(int newSize)
|
int |
size()
|
void |
start()
Starts to update the values with the previously set period. |
void |
start(long period)
Starts to update the values with the given period. |
void |
step()
Increase current index |
void |
stop()
Stop to update the values. |
java.util.List |
subList(int fromIndex,
int toIndex)
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.String |
toString()
|
void |
trimToSize()
|
| Methods inherited from class java.util.Vector |
|---|
removeRange |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MARKER
protected DataSourceCollection target
protected long period
protected java.util.Timer timer
protected boolean finished
protected boolean autoStop
| Constructor Detail |
|---|
public DataSourceCollectionAnimator(DataSourceCollection dsc)
| Method Detail |
|---|
public boolean isFinished()
public DataInfo getInformation()
getInformation in class DynamicDataSourceCollection
public void step()
throws DataException
DataExceptionpublic long getPeriod()
public void setPeriod(long period)
period, - in millisecondspublic boolean isRunning()
public void start(long period)
public void start()
public void stop()
public void reset()
public boolean isAutoStop()
public void setAutoStop(boolean autoStop)
autoStop - The autoStop to set.
protected DataSource createDataSource(DataInfo info,
int kind)
DynamicDataSourceCollection
createDataSource in class DynamicDataSourceCollectioninfo - Any information that will describe the data source, null is possible but
not recommended.kind - the data source kind, see ValueProvider. Object is default.
protected DataSource createDataSource(DataInfo info)
createDataSource in class DynamicDataSourceCollection
public void DataSourceCollectionInfoChanged(DataSourceCollection dsc,
DataInfo newInfo)
DataSourceCollectionListener
DataSourceCollectionInfoChanged in interface DataSourceCollectionListenerdsc - The data source collection that changednewInfo - The new information concerning this collection
public void DataSourceCollectionDataSourceAdded(DataSourceCollection dsc,
DataSource ds)
DataSourceCollectionListener
DataSourceCollectionDataSourceAdded in interface DataSourceCollectionListenerdsc - The data source collection that changedds - The data source that was added
public void DataSourceCollectionDataSourceRemoved(DataSourceCollection dsc,
DataSource ds)
DataSourceCollectionListener
DataSourceCollectionDataSourceRemoved in interface DataSourceCollectionListenerdsc - The data source collection that changedds - The data source that was removedpublic void DataSourceCollectionRemoved(DataSourceCollection dsc)
DataSourceCollectionListener
DataSourceCollectionRemoved in interface DataSourceCollectionListenerdsc - The data source collection that has been removedpublic DataSource get(java.lang.String id)
get in class DataSourceCollectionpublic void copyInto(java.lang.Object[] anArray)
copyInto in class java.util.Vectorpublic void trimToSize()
trimToSize in class java.util.Vectorpublic void ensureCapacity(int minCapacity)
ensureCapacity in class java.util.Vectorpublic void setSize(int newSize)
setSize in class java.util.Vectorpublic int capacity()
capacity in class java.util.Vectorpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.Vectorpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in class java.util.Vectorpublic java.util.Enumeration elements()
elements in class java.util.Vectorpublic boolean contains(java.lang.Object elem)
contains in interface java.util.Collectioncontains in interface java.util.Listcontains in class java.util.Vectorpublic int indexOf(java.lang.Object elem)
indexOf in interface java.util.ListindexOf in class java.util.Vector
public int indexOf(java.lang.Object elem,
int index)
indexOf in class java.util.Vectorpublic int lastIndexOf(java.lang.Object elem)
lastIndexOf in interface java.util.ListlastIndexOf in class java.util.Vector
public int lastIndexOf(java.lang.Object elem,
int index)
lastIndexOf in class java.util.Vectorpublic java.lang.Object elementAt(int index)
elementAt in class java.util.Vectorpublic java.lang.Object firstElement()
firstElement in class java.util.Vectorpublic java.lang.Object lastElement()
lastElement in class java.util.Vector
public void setElementAt(java.lang.Object obj,
int index)
setElementAt in class java.util.Vectorpublic void removeElementAt(int index)
removeElementAt in class java.util.Vector
public void insertElementAt(java.lang.Object obj,
int index)
insertElementAt in class java.util.Vectorpublic void addElement(java.lang.Object obj)
addElement in class java.util.Vectorpublic boolean removeElement(java.lang.Object obj)
removeElement in class java.util.Vectorpublic void removeAllElements()
removeAllElements in class DataSourceCollectionpublic java.lang.Object clone()
clone in class java.util.Vectorpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.Vectorpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.Vectorpublic java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.Vector
public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class java.util.Vectorpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.Vectorpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listremove in class java.util.Vector
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.Vectorpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.Vectorpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.Vectorpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in class java.util.Vectorpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in class java.util.Vectorpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in class java.util.Vectorpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in class java.util.Vector
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class java.util.Vectorpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Listequals in class java.util.Vectorpublic int hashCode()
DataSourceCollection
hashCode in interface java.util.CollectionhashCode in interface java.util.ListhashCode in class DataSourceCollectionpublic java.lang.String toString()
toString in class java.util.Vector
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.ListsubList in class java.util.Vectorpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractListpublic java.util.ListIterator listIterator()
listIterator in interface java.util.ListlistIterator in class java.util.AbstractListpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.ListlistIterator in class java.util.AbstractListpublic DataSourceCollection getTargetCollection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||