freemarker.testcase.models
Class StringNumberModel

java.lang.Object
  |
  +--freemarker.testcase.models.StringNumberModel
All Implemented Interfaces:
TemplateModel, TemplateNumberModel, TemplateScalarModel

public final class StringNumberModel
extends java.lang.Object
implements TemplateScalarModel, TemplateNumberModel

A simple model that implements both a String and a numeric value. This is used for testing conversions and method models.

Version:
$Id: StringNumberModel.java,v 1.3 2003/11/28 01:17:07 run2000 Exp $
Author:
Nicholas Cull

Constructor Summary
StringNumberModel(java.lang.String stringValue, long longValue)
          Constructor for initializing both a String and a number value.
 
Method Summary
 long getAsNumber()
          Retrieve the numeric value from the model.
 java.lang.String getAsString()
          Retrieve the scalar value from the model.
 boolean isEmpty()
          Is the model empty?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringNumberModel

public StringNumberModel(java.lang.String stringValue,
                         long longValue)
Constructor for initializing both a String and a number value.
Parameters:
stringValue -  
longValue -  
Method Detail

isEmpty

public boolean isEmpty()
Is the model empty?
Specified by:
isEmpty in interface TemplateModel
Returns:
false to indicate the model is not empty

getAsString

public java.lang.String getAsString()
Retrieve the scalar value from the model.
Specified by:
getAsString in interface TemplateScalarModel
Returns:
a String value

getAsNumber

public long getAsNumber()
Retrieve the numeric value from the model.
Specified by:
getAsNumber in interface TemplateNumberModel
Returns:
a long value