DESY ACOP Beans Home

com.cosylab.gui.displayers
Class DataSourceSupport

java.lang.Object
  extended by com.cosylab.gui.displayers.DataSourceSupport
All Implemented Interfaces:
DataSource, java.io.Serializable
Direct Known Subclasses:
AcopTransportDataSource, DataConsumerDispatcher

public class DataSourceSupport
extends java.lang.Object
implements DataSource, java.io.Serializable

DataSourceSupport is conveniencee implementation base for DataSource interface.

Since:
Nov 24, 2003.
Version:
$Id: DataSourceSupport.java,v 1.11 2008-04-22 12:31:02 jbobnar Exp $
Author:
Igor Kriznar
See Also:
Serialized Form

Field Summary
protected  java.lang.Class<DataConsumer>[] types
           
 
Constructor Summary
DataSourceSupport(java.lang.Class<DataConsumer>[] supportedTypes)
          Constructs support with defined supported types.
 
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 clear()
          Releases all consumers and goes into initial state.
protected  java.lang.Object clone()
           
 java.lang.String[] extractSupportedCharacteristics()
          Form all contained consumers extracts supported characteristics.
 java.lang.Class<DataConsumer>[] getAcceptableConsumerTypes()
          Returns the array of consumer types, which are acceptable by this data source.
 DataConsumer[] getConsumers()
          Returns array of registered data consumer.
 void removeAllConsumers()
          Clears all consumers from this DataSource.
 void removeConsumer(DataConsumer consumer)
          Deregisters data consumer from this data source.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

protected java.lang.Class<DataConsumer>[] types
Constructor Detail

DataSourceSupport

public DataSourceSupport(java.lang.Class<DataConsumer>[] supportedTypes)
Constructs support with defined supported types.

Parameters:
supportedTypes - types of DataConsumer that this source will support
Method Detail

addConsumer

public void addConsumer(DataConsumer consumer)
                 throws java.beans.PropertyVetoException
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
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)

removeConsumer

public void removeConsumer(DataConsumer consumer)
Description copied from interface: DataSource
Deregisters data consumer from this data source.

Specified by:
removeConsumer in interface DataSource
Parameters:
consumer - data consumer to be deregistered

getConsumers

public DataConsumer[] getConsumers()
Description copied from interface: DataSource
Returns array of registered data consumer.

Specified by:
getConsumers in interface DataSource
Returns:
array of registered data consumer

removeAllConsumers

public void removeAllConsumers()
Clears all consumers from this DataSource.

Specified by:
removeAllConsumers in interface DataSource

getAcceptableConsumerTypes

public java.lang.Class<DataConsumer>[] getAcceptableConsumerTypes()
Description copied from interface: DataSource
Returns the array of consumer types, which are acceptable by this data source.

Specified by:
getAcceptableConsumerTypes in interface DataSource
Returns:
the array of acceptable data source types

extractSupportedCharacteristics

public java.lang.String[] extractSupportedCharacteristics()
Form all contained consumers extracts supported characteristics.

Returns:
characteristic names from all contained consumers

clear

public void clear()
Releases all consumers and goes into initial state.


clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException


Copyright © 2010. All Rights Reserved.