Package freemarker.template
Class SimpleNumber
java.lang.Object
freemarker.template.SimpleNumber
- All Implemented Interfaces:
TemplateModel
,TemplateNumberModel
,Serializable
A simple implementation of the
TemplateNumberModel
interface. Note that this class is immutable.
This class is thread-safe.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
Constructor Summary
ConstructorDescriptionSimpleNumber(byte val)
SimpleNumber(double val)
SimpleNumber(float val)
SimpleNumber(int val)
SimpleNumber(long val)
SimpleNumber(short val)
SimpleNumber(Number value)
-
Method Summary
-
Constructor Details
-
SimpleNumber
-
SimpleNumber
public SimpleNumber(byte val) -
SimpleNumber
public SimpleNumber(short val) -
SimpleNumber
public SimpleNumber(int val) -
SimpleNumber
public SimpleNumber(long val) -
SimpleNumber
public SimpleNumber(float val) -
SimpleNumber
public SimpleNumber(double val)
-
-
Method Details
-
getAsNumber
Description copied from interface:TemplateNumberModel
Returns the numeric value. The return value must not benull
.- Specified by:
getAsNumber
in interfaceTemplateNumberModel
- Returns:
- the
Number
instance associated with this number model.
-
toString
-