DESY ACOP Beans Home

de.desy.acop.transport.adapters
Class AcopDataSourceJoint

java.lang.Object
  extended by com.cosylab.gui.displayers.DataSourceSupport
      extended by de.desy.acop.transport.adapters.AcopTransportDataSource
          extended by de.desy.acop.transport.adapters.AcopDataSourceJoint
All Implemented Interfaces:
DataSourceJoint<AcopTransportDataSource>, DataSource, AcopTransportListener, java.io.Serializable, java.util.EventListener

public class AcopDataSourceJoint
extends AcopTransportDataSource
implements DataSourceJoint<AcopTransportDataSource>

AcopDataSourceJoint is an implementation of DataSourceJoint which combines several AcopTransportDataSource. DataSources are combined in the manner prescribed by the DataSourceJoint API.

AcopDataSourceJoint supports only com.cosylabu.gui.displayers.DoubleSeqConsumer

Author:
Jaka Bobnar, Cosylab
See Also:
Serialized Form

Nested Class Summary
protected  class AcopDataSourceJoint.DataSourceWrapper
           
 
Field Summary
protected  java.util.ArrayList<AcopDataSourceJoint.DataSourceWrapper> dataSources
           
 
Fields inherited from class de.desy.acop.transport.adapters.AcopTransportDataSource
data, dcon, objectData, scon, sseqcon
 
Fields inherited from class com.cosylab.gui.displayers.DataSourceSupport
types
 
Fields inherited from interface com.cosylab.gui.adapters.DataSourceJoint
ADD, DIVIDE, FIRST_IN_A_ROW, MULTIPLY, SUBSTRACT
 
Constructor Summary
AcopDataSourceJoint()
          Constructs a new AcopDataSOurceJoint object.
 
Method Summary
 void addConsumer(DataConsumer consumer)
          This support implementation does not perform any type check on consumer, it just adds it to list of consumers.
 void addDataSource(AcopTransportDataSource dataSource, java.lang.String operation)
          Adds a DataSource to the chain of source as the last dataSource.
 void addDataSource(AcopTransportDataSource dataSource, java.lang.String operation, int index)
          Adds a DataSource to the chain of source at the position specified by index.
 java.util.Map<AcopTransportDataSource,java.lang.String> getDataSources()
          Returns a Map of all dataSources and their identifiers.
 java.lang.String removeDataSource(AcopTransportDataSource dataSource)
          Removes the dataSource from this joint.
 
Methods inherited from class de.desy.acop.transport.adapters.AcopTransportDataSource
clear, connect, dataEventReceived, disconnect, getCharacteristics, getConnectionParameters, getDataFormat, getDataLength, getReverseConsumer, getTransport, removeConsumer, setDataFormat
 
Methods inherited from class com.cosylab.gui.displayers.DataSourceSupport
clone, extractSupportedCharacteristics, getAcceptableConsumerTypes, getConsumers, removeAllConsumers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.gui.displayers.DataSource
getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer
 

Field Detail

dataSources

protected java.util.ArrayList<AcopDataSourceJoint.DataSourceWrapper> dataSources
Constructor Detail

AcopDataSourceJoint

public AcopDataSourceJoint()
Constructs a new AcopDataSOurceJoint object.

Method Detail

getDataSources

public java.util.Map<AcopTransportDataSource,java.lang.String> getDataSources()
Description copied from interface: DataSourceJoint
Returns a Map of all dataSources and their identifiers. The map is expected to use data sources as keys and operation identifiers as values. The order of data sources should be preserved.

Specified by:
getDataSources in interface DataSourceJoint<AcopTransportDataSource>
Returns:
a map of all data sources

removeDataSource

public java.lang.String removeDataSource(AcopTransportDataSource dataSource)
Description copied from interface: DataSourceJoint
Removes the dataSource from this joint. When a single DataSource is removed, it should not have any effects on the complete chain of sources. The sources that are further down in the chain should be moves upward. Method should return identifier of the operation associated with the removed data source.

Specified by:
removeDataSource in interface DataSourceJoint<AcopTransportDataSource>
Parameters:
dataSource - DataSource to be removed
Returns:
operation associated with the data source

addDataSource

public void addDataSource(AcopTransportDataSource dataSource,
                          java.lang.String operation)
                   throws java.beans.PropertyVetoException
Description copied from interface: DataSourceJoint
Adds a DataSource to the chain of source as the last dataSource. The operation between added DataSource and the existing chain is specified by operation parameter, which can be one of the public identifiers.

Specified by:
addDataSource in interface DataSourceJoint<AcopTransportDataSource>
Throws:
java.beans.PropertyVetoException

addDataSource

public void addDataSource(AcopTransportDataSource dataSource,
                          java.lang.String operation,
                          int index)
                   throws java.beans.PropertyVetoException
Description copied from interface: DataSourceJoint
Adds a DataSource to the chain of source at the position specified by index. The operation between added DataSource and the existing chain is specified by operation parameter, which can be one of the public identifiers. The FIRST_IN_A_ROW is specified by index 0. If a DataSource is added as first in a row it would replace the existing first DataSource and its identifier should be automatically changed to FIRST_IN_A_ROW if a different one is given.

Specified by:
addDataSource in interface DataSourceJoint<AcopTransportDataSource>
Throws:
java.beans.PropertyVetoException

addConsumer

public void addConsumer(DataConsumer consumer)
                 throws java.beans.PropertyVetoException
Description copied from class: DataSourceSupport
This support implementation does not perform any type check on consumer, it just adds it to list of consumers.

Specified by:
addConsumer in interface DataSource
Overrides:
addConsumer in class AcopTransportDataSource
Parameters:
consumer - the data consumer to be regitered at this data source
Throws:
java.beans.PropertyVetoException
See Also:
DataSource.addConsumer(com.cosylab.gui.displayers.DataConsumer)


Copyright © 2010. All Rights Reserved.