|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.template.FastListRange
public final class FastListRange
A simple list model that represents a range of values. For memory
conservation, we store the from and to values only. For a range that
iterates backwards, set the toValue to be lower than the
fromValue.
| Constructor Summary | |
|---|---|
FastListRange(long fromValue,
long toValue)
Constructor that takes from and to values to represent the indexModel of values. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Tests this object for equality with the given object. |
TemplateModel |
getAtIndex(long index)
Get the value at the specified index. |
int |
hashCode()
Return the hash value for this object. |
boolean |
isEmpty()
Is the range empty? |
void |
releaseIterator(TemplateIteratorModel iterator)
Reclaim the iterator. |
TemplateIteratorModel |
templateIterator()
Get a new iterator for this template model. |
java.lang.String |
toString()
Return the string value of this list range. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FastListRange(long fromValue,
long toValue)
fromValue - the start of the rangetoValue - the end of the range| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface TemplateModelfalse, because there is always at least one
value in the range
public TemplateModel getAtIndex(long index)
throws TemplateModelException
getAtIndex in interface TemplateIndexedModelindex - the index of the item we're after
FastNumber containing the value at the
given index
TemplateModelException - the index was out of boundspublic TemplateIteratorModel templateIterator()
templateIterator in interface TemplateListModel2public void releaseIterator(TemplateIteratorModel iterator)
releaseIterator in interface TemplateListModel2iterator - the iterator to be reclaimedpublic java.lang.String toString()
Return the string value of this list range. The values typically look like this:
[ {fromValue} .. {toValue} ]
toString in class java.lang.ObjectString representing this rangepublic 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 | ||||||||