TemplateNumberModel (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, interface: TemplateNumberModel

Package freemarker.template

# Interface TemplateNumberModel

All Superinterfaces:
  `TemplateModel`

All Known Implementing Classes:
  `JythonNumberModel`, `NumberModel`, `RhinoFunctionModel`, `RhinoScriptableModel`, `SimpleNumber`

public interface TemplateNumberModel extends TemplateModel
"number" template language data type; an object that stores a number. There's only one numerical type as far as the template language is concerned, but it can store its value using whatever Java number type. Making operations between numbers (and so the coercion rules) is up to the `ArithmeticEngine`.

Objects of this type should be immutable, that is, calling `getAsNumber()` should always return the same value as for the first time.

- ## Field Summary

  ### Fields inherited from interface freemarker.template.TemplateModel

  `NOTHING`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Number`
  `getAsNumber()`
  Returns the numeric value.

- ## Method Details

  - ### getAsNumber

    Number getAsNumber() throws TemplateModelException
    Returns the numeric value. The return value must not be `null`.
    Returns:
      the `Number` instance associated with this number model.
    Throws:
      `TemplateModelException`