|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- type of DataSources added to this jointpublic interface DataSourceJoint<T extends DataSource>
DataSourceJoint
combines several DataSources and dispatch all
their data in a prescribed manner. Each DataSource should be added to this
joint together with an identifer that specifies what this joint should do
with the data received from that particular source. The first DataSource in
the joint should always have an identifier FIRST_IN_A_ROW, following by data
sources with any other operation identifier. There can be only one source
with identifier FIRST_IN_A_ROW.
When a new DataSource
is added it should be the last in the
chain of all data sources if not specified otherwise. Value from each
DataSource
should meet an arythmetic operation with the value
calculated from sources that are higher up in the chain (were added to this
joint earlier).
addDataSource(source1, FIRST_IN_A_ROW); addDataSource(source2, ADD); addDataSource(source3, MULTIPLY); should give a result of (source1 + source2)* source3.
Field Summary | |
---|---|
static java.lang.String |
ADD
Identifier for addition |
static java.lang.String |
DIVIDE
Identifier for division |
static java.lang.String |
FIRST_IN_A_ROW
Identifier for the first DataSource |
static java.lang.String |
MULTIPLY
Identifier for multiplication |
static java.lang.String |
SUBSTRACT
Identifier for substraction |
Method Summary | |
---|---|
void |
addDataSource(T dataSource,
java.lang.String operation)
Adds a DataSource to the chain of source as the last
dataSource. |
void |
addDataSource(T dataSource,
java.lang.String operation,
int index)
Adds a DataSource to the chain of source at the position
specified by index. |
java.util.Map<T,java.lang.String> |
getDataSources()
Returns a Map of all dataSources and their identifiers. |
java.lang.String |
removeDataSource(T dataSource)
Removes the dataSource from this joint. |
Methods inherited from interface com.cosylab.gui.displayers.DataSource |
---|
addConsumer, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer |
Field Detail |
---|
static final java.lang.String FIRST_IN_A_ROW
static final java.lang.String MULTIPLY
static final java.lang.String DIVIDE
static final java.lang.String ADD
static final java.lang.String SUBSTRACT
Method Detail |
---|
void addDataSource(T dataSource, java.lang.String operation) throws java.lang.IllegalArgumentException, java.beans.PropertyVetoException
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.
dataSource
- operation
-
java.lang.IllegalArgumentException
- when a given datasource have operation FIRST_IN_A_ROW and a
DataSource with this identifier already exists
java.beans.PropertyVetoException
void addDataSource(T dataSource, java.lang.String operation, int index) throws java.lang.IllegalArgumentException, java.beans.PropertyVetoException
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.
dataSource
- operation
- index
-
java.lang.IllegalArgumentException
- when a given index is invalid (larger than the number of data
sources in this joint)
java.beans.PropertyVetoException
java.lang.String removeDataSource(T dataSource)
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.
dataSource
- DataSource to be removed
java.util.Map<T,java.lang.String> getDataSources()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |