Package mgui.models.environments
Class AbstractEnvironmentDataSource<T extends MguiNumber>
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.models.environments.AbstractEnvironmentDataSource<T>
- Type Parameters:
T- Number type for this data source
- All Implemented Interfaces:
InterfaceObject,InterfaceDataSource<T>,InterfaceDataSourceTimeSeries<T>,InterfaceDataSourceXY<T>,NamedDataSource,NamedObject,TreeObject,CleanableObject,DynamicModelEnvironmentSensor
- Direct Known Subclasses:
SimpleEnvironmentInputDataSource,SimpleEnvironmentObservableDataSource
public abstract class AbstractEnvironmentDataSource<T extends MguiNumber> extends AbstractInterfaceObject implements InterfaceDataSourceTimeSeries<T>, DynamicModelEnvironmentSensor, NamedDataSource
Serves as a data source updated by a
DynamicModelEnvironment.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description protected Tclockprotected intindexprotected booleanisDestroyedNameMapnamesprotected java.util.ArrayList<T>signalprotected java.util.ArrayList<DataSourceListener>sourceListenersFields inherited from class mgui.interfaces.AbstractInterfaceObject
tree_nodes -
Constructor Summary
Constructors Constructor Description AbstractEnvironmentDataSource() -
Method Summary
Modifier and Type Method Description voidaddDataSourceListener(DataSourceListener l)voiddestroy()Destroy this object (prepare it to be removed from memory)protected voidfireEmission()protected voidfireReset()java.util.ArrayList<java.lang.String>getChannelNames()intgetIndex()java.lang.StringgetName()Gets the name for this object.java.util.List<T>getSourceSignal()Returns a list of typeT, representing a signal emission.byte[]getSourceSignalAsBytes()Returns an array of bytes, representing a signal emission.java.util.List<T>getSourceSignalX()Returns the X data for this source.java.util.List<T>getSourceSignalX(int i)Returns the X data corresponding to this signal's i'th channel.java.util.List<XYData<T>>getSourceSignalXY(int i)Returns the X-Y data corresponding to this signal's i'th channel.java.util.List<java.util.List<T>>getSourceSignalY()Returns the Y data corresponding to all channels.java.util.List<T>getSourceSignalY(int i)Returns the Y data corresponding to this signal's i'th channel.booleanisDestroyed()Test whether this object has been destroyedvoidremoveDataSourceListener(DataSourceListener l)voidreset()voidsetChannelNames(java.util.List<java.lang.String> names)voidsetIndex(int i)Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, getTreeLabel, issueTreeNode, setName, setTreeNode, updateTreeNodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
cleanMethods inherited from interface mgui.models.dynamic.DynamicModelEnvironmentSensor
stimulateMethods inherited from interface mgui.interfaces.io.InterfaceDataSourceTimeSeries
getChannelCountMethods inherited from interface mgui.interfaces.NamedObject
setNameMethods inherited from interface mgui.interfaces.trees.TreeObject
getTreeLabel, issueTreeNode, setTreeNode
-
Field Details
-
names
-
signal
-
clock
-
index
protected int index -
sourceListeners
-
isDestroyed
protected boolean isDestroyed
-
-
Constructor Details
-
AbstractEnvironmentDataSource
public AbstractEnvironmentDataSource()
-
-
Method Details
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceDynamicModelEnvironmentSensor
-
setIndex
public void setIndex(int i)- Specified by:
setIndexin interfaceDynamicModelEnvironmentSensor
-
getSourceSignal
Description copied from interface:InterfaceDataSourceReturns a list of typeT, representing a signal emission.- Specified by:
getSourceSignalin interfaceInterfaceDataSource<T extends MguiNumber>- Returns:
-
getSourceSignalAsBytes
public byte[] getSourceSignalAsBytes()Description copied from interface:InterfaceDataSourceReturns an array of bytes, representing a signal emission.- Specified by:
getSourceSignalAsBytesin interfaceInterfaceDataSource<T extends MguiNumber>- Returns:
-
getChannelNames
public java.util.ArrayList<java.lang.String> getChannelNames()- Specified by:
getChannelNamesin interfaceNamedDataSource
-
setChannelNames
public void setChannelNames(java.util.List<java.lang.String> names)- Specified by:
setChannelNamesin interfaceNamedDataSource
-
addDataSourceListener
- Specified by:
addDataSourceListenerin interfaceInterfaceDataSource<T extends MguiNumber>
-
removeDataSourceListener
- Specified by:
removeDataSourceListenerin interfaceInterfaceDataSource<T extends MguiNumber>
-
fireEmission
protected void fireEmission() -
fireReset
protected void fireReset() -
reset
public void reset()- Specified by:
resetin interfaceDynamicModelEnvironmentSensor
-
getSourceSignalX
Description copied from interface:InterfaceDataSourceTimeSeriesReturns the X data for this source.- Specified by:
getSourceSignalXin interfaceInterfaceDataSourceTimeSeries<T extends MguiNumber>- Returns:
-
getSourceSignalY
Description copied from interface:InterfaceDataSourceTimeSeriesReturns the Y data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalYin interfaceInterfaceDataSourceTimeSeries<T extends MguiNumber>- Specified by:
getSourceSignalYin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getSourceSignalY
Description copied from interface:InterfaceDataSourceTimeSeriesReturns the Y data corresponding to all channels.- Specified by:
getSourceSignalYin interfaceInterfaceDataSourceTimeSeries<T extends MguiNumber>- Returns:
-
getSourceSignalXY
Description copied from interface:InterfaceDataSourceXYReturns the X-Y data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalXYin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getSourceSignalX
Description copied from interface:InterfaceDataSourceXYReturns the X data corresponding to this signal's i'th channel.- Specified by:
getSourceSignalXin interfaceInterfaceDataSourceXY<T extends MguiNumber>- Returns:
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceDynamicModelEnvironmentSensor- Specified by:
getNamein interfaceNamedObject- Overrides:
getNamein classAbstractInterfaceObject- Returns:
-
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject- Overrides:
destroyin classAbstractInterfaceObject
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObjectTest whether this object has been destroyed- Specified by:
isDestroyedin interfaceInterfaceObject- Overrides:
isDestroyedin classAbstractInterfaceObject- Returns:
-