net.sf.antcontrib.math

Class Numeric

Implemented Interfaces:
Evaluateable

public class Numeric
extends java.lang.Object
implements Evaluateable

A numeric value that implements Evaluateable.
Author:
inger

Method Summary

Number
evaluate()
String
getDatatype()
void
setDatatype(String p)
Sets the datatype of this number.
void
setValue(String value)
Set the value for this number.
String
toString()

Method Details

evaluate

public Number evaluate()
Specified by:
evaluate in interface Evaluateable
Returns:
the value for this number as a Number. Cast as appropriate to Integer, Long, Float, or Double.

getDatatype

public String getDatatype()
Returns:
the datatype as one of the defined types.

setDatatype

public void setDatatype(String p)
Sets the datatype of this number. Allowed values are "int", "long", "float", or "double".

setValue

public void setValue(String value)
Set the value for this number. This string must parse to the set datatype, for example, setting value to "7.992" and datatype to INT will cause a number format exception to be thrown. Supports two special numbers, "E" and "PI".
Parameters:
value - the value for this number

toString

public String toString()