|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.expression.ListRange
public final class ListRange
An expression that represents a indexModel of list values. The from and to
expressions are held until evaluation time, then a FastListRange
is created. A simple FastIndexedIterator
is used
to iterate over the values.
Constructor Summary | |
---|---|
ListRange(Expression fromRange,
Expression toRange)
Constructor that takes from and to values in the form of expressions. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Determines whether this object is equal to the given object. |
TemplateModel |
getAsTemplateModel(TemplateWriteableHashModel modelRoot)
Retrieve the list range as a template model. |
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 |
isComplete()
Do we have from and to values? |
boolean |
isConstant()
Determine whether result calculated by this expression is a constant value. |
Expression |
resolveExpression()
Resolves the current expression, possibly into a different expression object. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ListRange(Expression fromRange, Expression toRange)
FastListRange
.
fromRange
- the start of the range, as an expressiontoRange
- the end of the range, as an expression
java.lang.NullPointerException
- fromRange or toRange are null
java.lang.IllegalArgumentException
- the expressions cannot be evaluated as numbersMethod Detail |
---|
public TemplateModel getAsTemplateModel(TemplateWriteableHashModel modelRoot) throws TemplateException
getAsTemplateModel
in interface Expression
modelRoot
- the model from which to evaluate the range of the
list
FastListRange
representing the range list
TemplateException
- the new range could not be createdpublic boolean isComplete()
isComplete
in interface Expression
true
if both from and to values are specified,
otherwise false
public java.util.Set<ExpressionUtils.ExpressionType> getType()
ExpressionUtils
class.
getType
in interface Expression
public boolean isConstant()
isConstant
in interface Expression
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of this expressionpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared with
true
if the objects are equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
public Expression resolveExpression() throws TemplateException
readResolve
method. Situations where this may be used are:
resolveExpression
in interface Expression
TemplateException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |