|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.template.expression.AbstractBinary
freemarker.template.expression.Plus
public final class Plus
An addition operator. Handles both String concatenation as well as numeric arithmetic.
| Field Summary |
|---|
| Fields inherited from class freemarker.template.expression.AbstractBinary |
|---|
left, right |
| Constructor Summary | |
|---|---|
Plus()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
TemplateModel |
getAsTemplateModel(TemplateWriteableHashModel modelRoot)
Performs addition on the two expressions set previously. |
ExpressionBuilder.Precedence |
getPrecedence()
Return the precedence for this operator to the caller. |
java.util.Set<ExpressionUtils.ExpressionType> |
getType()
Determine the type of result that can be calculated by this expression. |
int |
hashCode()
Returns the hash code for this operator. |
boolean |
isConstant()
Determine whether result calculated by this expression is a constant value. |
void |
setLeft(Expression left)
Sets the left-hand side of the expression. |
void |
setRight(Expression right)
Sets the right-hand side of the expression. |
java.lang.String |
toString()
Returns a string representation of the object. |
| Methods inherited from class freemarker.template.expression.AbstractBinary |
|---|
isComplete, resolveExpression |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Plus()
| Method Detail |
|---|
public void setLeft(Expression left)
setLeft in interface BinarysetLeft in class AbstractBinaryleft - the left-hand side of the expression
java.lang.NullPointerException - the argument was null
java.lang.IllegalArgumentException - the argument was neither a String
nor a numberpublic void setRight(Expression right)
setRight in interface BinarysetRight in class AbstractBinaryright - the right-hand side of the expression
java.lang.NullPointerException - the argument was null
java.lang.IllegalArgumentException - the argument was neither a String
nor a number
public TemplateModel getAsTemplateModel(TemplateWriteableHashModel modelRoot)
throws TemplateException
getAsTemplateModel in interface ExpressionmodelRoot - the template model that will be evaluated by the expression
FastScalar of the concatenated models,
or a FastNumber of the added models
TemplateException - the expression could not be evaluated for some reasonpublic java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils class.
getType in interface Expressionpublic boolean isConstant()
isConstant in interface Expressionpublic ExpressionBuilder.Precedence getPrecedence()
getPrecedence in interface Operatorpublic java.lang.String toString()
toString in class java.lang.ObjectString representation of this expressionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to be compared with
true if the objects are equal, otherwise
falsepublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||