|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cosylab.gui.adapters.ConverterChain
public class ConverterChain
ConverterChain combines several converter into a single one.
Single converters can be added to this chain. The value will then be converted
by each of this single converters resulting in an arbitrary function applied
to the input value.
| Constructor Summary | |
|---|---|
ConverterChain()
Creates new instance of ConverterChain. |
|
ConverterChain(Converter[] converters)
Creates new instance of ConverterChain. |
|
| Method Summary | ||
|---|---|---|
void |
addConsumer(DataConsumer consumer)
Registers data consumer at this data source. |
|
java.lang.Object |
clone()
|
|
Converter |
get(int index)
Returns the converter under the specified index. |
|
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. |
|
Converter[] |
getConverters()
Returns all converters in the chain. |
|
|
getDataConsumer(java.lang.Class<D> type)
Returns data consumer for requested data consumer type. |
|
DataConsumer |
getDefaultDataConsumer()
Returns the implementation of default consumer type supported by this data consumer. |
|
Converter |
getFirst()
Returns the first converter in the chain. |
|
Converter |
getLast()
Returns the last converter in the chain. |
|
java.lang.String |
getName()
Returns name of this data consumer. |
|
java.lang.String[] |
getSupportedCharacteristics()
Resturns array with names of supported characteristics. |
|
java.lang.Class<DataConsumer>[] |
getSupportedConsumerTypes()
Returns array of supported data consumer types, which can be used as parameter and returnned with getDataCosnumer(Class)
method. |
|
void |
removeAllConsumers()
Removes all consumers from data source and releases all resources and bindings allocated inside datasource to the consumers. |
|
void |
removeConsumer(DataConsumer consumer)
Deregisters data consumer from this data source. |
|
void |
setCharacteristics(java.util.Map characteristics)
Sets new dynamic value characteristics to this data consumer. |
|
int |
size()
Returns the number of all converters in the chain. |
|
java.lang.String |
toString()
|
|
void |
updateDataState(DataState state)
Push data state (quality) update change for dynamic value. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConverterChain()
throws java.beans.PropertyVetoException
java.beans.PropertyVetoException
public ConverterChain(Converter[] converters)
throws java.beans.PropertyVetoException
java.beans.PropertyVetoException| Method Detail |
|---|
public void addConsumer(DataConsumer consumer)
throws java.beans.PropertyVetoException
DataSourcePropertyVetoException if consumer
does not provide necessary DataConsumer type.
addConsumer in interface DataSourceconsumer - the data consumer to be regitered at this data source
java.beans.PropertyVetoExceptionDataConsumer.getDataConsumer(Class)public void removeConsumer(DataConsumer consumer)
DataSource
removeConsumer in interface DataSourceconsumer - data consumer to be deregisteredpublic DataConsumer[] getConsumers()
DataSource
getConsumers in interface DataSourcepublic java.lang.Class<DataConsumer>[] getAcceptableConsumerTypes()
DataSource
getAcceptableConsumerTypes in interface DataSourcepublic void removeAllConsumers()
DataSource
removeAllConsumers in interface DataSourcepublic <D extends DataConsumer> D getDataConsumer(java.lang.Class<D> type)
DataConsumer
Returns data consumer for requested data consumer type. If this data
consumer does not support required data consumer, null is
returned.
If this data cosnumer does not support specific data consumer type, then it means, that it is not desirable to cast data of that type to any by this consumer supported data consumer types.
getDataConsumer in interface DataConsumertype - Class of specific data consumer (e.g. DoubleConsumer)
null if
not supportedpublic DataConsumer getDefaultDataConsumer()
DataConsumer
getDefaultDataConsumer in interface DataConsumerpublic void updateDataState(DataState state)
DataConsumer
updateDataState in interface DataConsumerstate - new data state(quality) descriptorpublic void setCharacteristics(java.util.Map characteristics)
DataConsumer
setCharacteristics in interface DataConsumercharacteristics - the Map with attripublic java.lang.String getName()
DataConsumer
getName in interface DataConsumerpublic java.lang.String[] getSupportedCharacteristics()
DataConsumernull is returned, than
consumer expect all existing characteristics from data source.
getSupportedCharacteristics in interface DataConsumerpublic java.lang.Class<DataConsumer>[] getSupportedConsumerTypes()
DataConsumergetDataCosnumer(Class)
method.
getSupportedConsumerTypes in interface DataConsumerpublic Converter getLast()
public Converter getFirst()
public Converter get(int index)
index - index of the requested converter
public int size()
public Converter[] getConverters()
public java.lang.String toString()
toString in class java.lang.Object
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface Converterclone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||