|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.FastNumber
public final class FastNumber
An unsynchronized, immutable implementation of the TemplateNumberModel
interface. This avoids the need for synchronization, since we don't have any
situations where the underlying value changes.
FastBoolean
,
FastHash
,
FastList
,
FastScalar
,
Serialized FormConstructor Summary | |
---|---|
FastNumber(long longValue)
Constructs an instance of this object with an initial value. |
|
FastNumber(java.lang.Number numberValue)
Constructs an instance of this object with an initial value. |
|
FastNumber(java.lang.String stringValue)
Constructs an instance of this object with an initial value. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Tests this object for equality with the given object. |
long |
getAsNumber()
Returns the scalar's value as a String . |
int |
hashCode()
Return the hash value for this object. |
boolean |
isEmpty()
Is the scalar value empty? |
java.lang.String |
toString()
Return the value of this object as a String . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FastNumber(java.lang.String stringValue)
stringValue
- the value to store
java.lang.NullPointerException
- the value is null
java.lang.NumberFormatException
- the value could not be parsed as a longpublic FastNumber(long longValue)
longValue
- the value to storepublic FastNumber(java.lang.Number numberValue)
numberValue
- the value to storeMethod Detail |
---|
public long getAsNumber() throws TemplateModelException
String
.
getAsNumber
in interface TemplateNumberModel
TemplateModelException
public boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
true
if this String
is empty
or null
, otherwise false
.
TemplateModelException
public java.lang.String toString()
String
.
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared against
true
if the objects are equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |