DESY ACOP Beans Home

com.cosylab.gui.adapters
Class PotentialConverter

java.lang.Object
  extended by com.cosylab.gui.displayers.DataSourceSupport
      extended by com.cosylab.gui.adapters.DataConsumerDispatcher
          extended by com.cosylab.gui.adapters.AbstractConverter
              extended by com.cosylab.gui.adapters.SimpleConverterSupport
                  extended by com.cosylab.gui.adapters.PotentialConverter
All Implemented Interfaces:
Converter, DataConsumer, DataSource, DoubleConsumer, DoubleSeqConsumer, java.io.Serializable, java.lang.Cloneable

public class PotentialConverter
extends SimpleConverterSupport
implements DoubleConsumer

PotentialConverter transforms the incomming value in the way that it exponents it to the given exponent factor. If the incomming value is x, the transformed value is x^exponent.

Version:
$Id: PotentialConverter.java,v 1.8 2008-04-22 12:31:02 jbobnar Exp $
Author:
Jaka Bobnar
See Also:
Serialized Form

Field Summary
static java.lang.String SHORT_NAME
           
 
Fields inherited from class com.cosylab.gui.adapters.SimpleConverterSupport
arrayIndex
 
Fields inherited from class com.cosylab.gui.adapters.AbstractConverter
nonblDispatcher
 
Fields inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher
name
 
Fields inherited from class com.cosylab.gui.displayers.DataSourceSupport
types
 
Constructor Summary
PotentialConverter()
          Constructs a new PotentialConverter with exponent factor 1.
PotentialConverter(double exponent)
          Constructs a new PotentialConverter with the supplied exponent.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 double getExponent()
          Returns the exponent factor.
 java.lang.String getName()
          Returns name of this data consumer.
protected  double inverseTransform(double value)
          User must implement this method to make inverse transformation as in transfirm(double) function.
 void setCharacteristics(java.util.Map characteristics)
          This is called by peer data source.
 void setExponent(double exponent)
          Sets the exponent factor of this converter.
 java.lang.String toString()
           
protected  double transform(double value)
          User must implement this method and from prvided parameter calculate with own transfromatin function new value and return it.
 
Methods inherited from class com.cosylab.gui.adapters.SimpleConverterSupport
getArrayIndex, getNonblDisplatecher, setArrayIndex, updateValue, updateValue
 
Methods inherited from class com.cosylab.gui.adapters.AbstractConverter
addConsumer, cacheLastCharacteristics, clear, clone, consumerAdded, getLastCharacteristics, updateDataState
 
Methods inherited from class com.cosylab.gui.adapters.DataConsumerDispatcher
getDataConsumer, getDefaultDataConsumer, getSupportedCharacteristics, getSupportedConsumerTypes
 
Methods inherited from class com.cosylab.gui.displayers.DataSourceSupport
extractSupportedCharacteristics, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.cosylab.gui.displayers.DoubleConsumer
updateValue
 
Methods inherited from interface com.cosylab.gui.displayers.DataConsumer
getDataConsumer, getDefaultDataConsumer, getSupportedCharacteristics, getSupportedConsumerTypes, updateDataState
 
Methods inherited from interface com.cosylab.gui.adapters.Converter
clone
 
Methods inherited from interface com.cosylab.gui.displayers.DataSource
addConsumer, getAcceptableConsumerTypes, getConsumers, removeAllConsumers, removeConsumer
 

Field Detail

SHORT_NAME

public static final java.lang.String SHORT_NAME
See Also:
Constant Field Values
Constructor Detail

PotentialConverter

public PotentialConverter()
Constructs a new PotentialConverter with exponent factor 1.


PotentialConverter

public PotentialConverter(double exponent)
Constructs a new PotentialConverter with the supplied exponent.

Parameters:
exponent -
Method Detail

inverseTransform

protected double inverseTransform(double value)
Description copied from class: SimpleConverterSupport
User must implement this method to make inverse transformation as in transfirm(double) function. Following must be true some_value == inverseTransform(transfirm(some_value)).

Specified by:
inverseTransform in class SimpleConverterSupport
Parameters:
value - the value to be transfirmed with inverse function
Returns:
the inversed value
See Also:
SimpleConverterSupport.transform(double)

getExponent

public double getExponent()
Returns the exponent factor.

Returns:

transform

protected double transform(double value)
Description copied from class: SimpleConverterSupport
User must implement this method and from prvided parameter calculate with own transfromatin function new value and return it.

Specified by:
transform in class SimpleConverterSupport
Parameters:
value - the value to be transfirmed
Returns:
the transformed value

setExponent

public void setExponent(double exponent)
Sets the exponent factor of this converter.

Parameters:
exponent -

getName

public java.lang.String getName()
Description copied from interface: DataConsumer
Returns name of this data consumer.

Specified by:
getName in interface DataConsumer
Overrides:
getName in class DataConsumerDispatcher
Returns:
the name of this data consumer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setCharacteristics

public void setCharacteristics(java.util.Map characteristics)
Description copied from class: AbstractConverter
This is called by peer data source. Call is delegated to contained consumers. In the process it is modified with transformation function.

Specified by:
setCharacteristics in interface DataConsumer
Overrides:
setCharacteristics in class AbstractConverter
Parameters:
characteristics - the Map with attri
See Also:
DataConsumer.setCharacteristics(java.util.Map)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.