|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfreemarker.testcase.models.ListModel2
public final class ListModel2
A simple list model for testing the list iterator functionality. This
implements the old TemplateListModel
interface to test
backward compatibility.
Constructor Summary | |
---|---|
ListModel2()
Default constructor that creates a simple list. |
Method Summary | |
---|---|
TemplateModel |
get(int index)
Retrieve an item at the given index |
TemplateModel |
get(java.lang.String key)
Implement special keys to retrieve the size of the list and the index of the current item. |
boolean |
hasNext()
Are there any more elements? |
boolean |
isEmpty()
Is the model empty? |
boolean |
isRewound()
Is the current item at the beginning of the list? |
TemplateModel |
next()
Retrieve the next item in the list. |
void |
rewind()
Rewind the current item to the beginning of the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListModel2()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface TemplateModel
true
if the list is empty, otherwise false
public boolean hasNext()
hasNext
in interface TemplateListModel
true
if there are more elements, otherwise
false
public TemplateModel next()
next
in interface TemplateListModel
public void rewind()
rewind
in interface TemplateListModel
public boolean isRewound()
isRewound
in interface TemplateListModel
true
if we are at the beginning of the list,
otherwise false
public TemplateModel get(int index)
get
in interface TemplateListModel
index
- the index of the item to be retrieved
public TemplateModel get(java.lang.String key) throws TemplateModelException
get
in interface TemplateHashModel
key
- the name of the value to be retrieved
null
TemplateModelException
- there was a problem getting the value
for the given key
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |