org.pentaho.reporting.engine.classic.core.util.beans
Class DoubleValueConverter

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.util.beans.DoubleValueConverter
All Implemented Interfaces:
ValueConverter

public class DoubleValueConverter
extends Object
implements ValueConverter

A class that handles the conversion of Double attributes to and from their String representation.

Author:
Thomas Morgner

Constructor Summary
DoubleValueConverter()
          Creates a new value converter.
 
Method Summary
 String toAttributeValue(Object o)
          Converts the attribute to a string.
 Object toPropertyValue(String s)
          Converts a string to a Double.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleValueConverter

public DoubleValueConverter()
Creates a new value converter.

Method Detail

toAttributeValue

public String toAttributeValue(Object o)
                        throws BeanException
Converts the attribute to a string.

Specified by:
toAttributeValue in interface ValueConverter
Parameters:
o - the attribute (Double expected).
Returns:
A string representing the Double value.
Throws:
BeanException - if there was an error during the conversion.

toPropertyValue

public Object toPropertyValue(String s)
                       throws BeanException
Converts a string to a Double.

Specified by:
toPropertyValue in interface ValueConverter
Parameters:
s - the string.
Returns:
a Double.
Throws:
BeanException - if there was an error during the conversion.