de.jaetzold.util
Class ConversionAdapter

java.lang.Object
  |
  +--de.jaetzold.util.ConversionAdapter
All Implemented Interfaces:
Conversion
Direct Known Subclasses:
ConstantConversion

public abstract class ConversionAdapter
extends Object
implements Conversion


Constructor Summary
ConversionAdapter()
           
 
Method Summary
abstract  double convert(double value)
           
 boolean getDeliversFloatingPoint()
          Tells whether this instance really delivers floating point values.
 boolean isCacheable()
          Tells whether this instance will in the future produce the same result for the same arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversionAdapter

public ConversionAdapter()
Method Detail

isCacheable

public boolean isCacheable()
Description copied from interface: Conversion
Tells whether this instance will in the future produce the same result for the same arguments. This can be false first and then true at a later time, but it is not legal to return false here after a return of true in the past, because the true answer before was wrong then.
Specified by:
isCacheable in interface Conversion
Following copied from interface: de.jaetzold.util.Conversion
Returns:
true if this instance guarantees, that any further call to convert(double) with the same argument returns the same result

getDeliversFloatingPoint

public boolean getDeliversFloatingPoint()
Description copied from interface: Conversion
Tells whether this instance really delivers floating point values. That means whether the result of a convert() can not always be cast to long without a loss of precision.
Specified by:
getDeliversFloatingPoint in interface Conversion

convert

public abstract double convert(double value)
Specified by:
convert in interface Conversion