FloatingPointTypepublic class FloatingPointType extends NumericType This class represents the types float and double. |
Constructors Summary |
---|
public FloatingPointType(String name, Class clazz, int enumType)
super(name, clazz, enumType);
|
Methods Summary |
---|
public java.lang.Number | getValue(java.lang.Number value)Converts the specified value into a value of this numeric type.
E.g. an Integer is converted into a Double, if this represents
the numeric type double.
Number ret = null;
if (value == null)
ret = null;
else if ("double".equals(getName()))
ret = new Double(value.doubleValue());
else if ("float".equals(getName()))
ret = new Float(value.floatValue());
return ret;
| public java.lang.Number | negate(java.lang.Number value)Returns -value.
Number ret = null;
if (value == null)
ret = null;
else if ("double".equals(getName()))
ret = new Double(-value.doubleValue());
else if ("float".equals(getName()))
ret = new Float(-value.floatValue());
return ret;
|
|