|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.FastIndexedIterator
An iterator that operates over a TemplateIndexedModel
implementation.
The assumption here is that we have constant-time random access to the
underlying implementation.
Field Summary | |
protected long |
currentIndex
The current index into the model. |
protected long |
endIndex
The end index of the model. |
protected TemplateIndexedModel |
indexModel
The model that we will index into. |
protected long |
startIndex
The beginning index of the model. |
Constructor Summary | |
FastIndexedIterator(TemplateIndexedModel model,
long startIndex,
long endIndex)
Constructor that takes the object we're iterating over as an argument |
Method Summary | |
boolean |
hasNext()
Do we have a next value? |
boolean |
isEmpty()
Is the iterator empty? |
TemplateModel |
next()
Return the next value in the indexModel, and increment the counter to point to the next value. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final TemplateIndexedModel indexModel
protected final long startIndex
protected final long endIndex
protected long currentIndex
Constructor Detail |
public FastIndexedIterator(TemplateIndexedModel model, long startIndex, long endIndex)
model
- the indexed list model to iterate overMethod Detail |
public boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
false
, indicating the iterator is not emptypublic boolean hasNext()
hasNext
in interface TemplateIteratorModel
true
if more values exist in the list,
otherwise false
public TemplateModel next() throws TemplateModelException
next
in interface TemplateIteratorModel
TemplateModel
representing the next value
in the listpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |