|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.template.FastListIterator<T>
public class FastListIterator<T extends TemplateModel>
Iterator class for FastList where the underlying Collection is a
List. Note that this model is not serializable, to match the
semantics of the underlying java.util.ListIterator.
FastList| Field Summary | |
|---|---|
protected int |
index
The index of the next item to be returned. |
protected java.util.ListIterator<T> |
iterator
The iterator being wrapped by this model. |
| Constructor Summary | |
|---|---|
FastListIterator(java.util.List<T> list)
Constructor that takes a java.util.List implementation
to iterator over. |
|
| Method Summary | |
|---|---|
TemplateModel |
get(java.lang.String key)
Gets a TemplateModel from the hash. |
boolean |
hasNext()
Do we have another item in the list? |
boolean |
isEmpty()
Is the object empty? |
TemplateModel |
next()
Retrieve the next item in the list. |
void |
set(TemplateModel model)
Inserts the specified element into the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.ListIterator<T extends TemplateModel> iterator
protected int index
| Constructor Detail |
|---|
public FastListIterator(java.util.List<T> list)
java.util.List implementation
to iterator over.
java.lang.NullPointerException - the collection is null| Method Detail |
|---|
public boolean hasNext()
throws TemplateModelException
hasNext in interface TemplateIteratorModeltrue if there are more items to be iterated over,
otherwise false
TemplateModelException - there was a problem determining the
next item in the list
public TemplateModel next()
throws TemplateModelException
TemplateModel
containing the underlying value.
next in interface TemplateIteratorModelTemplateModelException - the next item couldn't be retrieved,
or we're at the end of the list
public void set(TemplateModel model)
throws TemplateModelException
set in interface TemplateWriteableIteratorModelmodel - the model to insert into the list
TemplateModelException - the model could not be assigned
to the list
public TemplateModel get(java.lang.String key)
throws TemplateModelException
TemplateModel from the hash. The one key is "index",
which returns the current index of the iterator.
get in interface TemplateHashModelkey - the name by which the TemplateModel
is identified in the template.
TemplateModel referred to by the key,
or null if not found.
TemplateModelException - there was a problem getting the value
for the given key
public boolean isEmpty()
throws TemplateModelException
isEmpty in interface TemplateModeltrue if this object is empty, otherwise false
TemplateModelException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||