|
|||||||||
| 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 TemplateModeltrue if the list is empty, otherwise falsepublic boolean hasNext()
hasNext in interface TemplateListModeltrue if there are more elements, otherwise
falsepublic TemplateModel next()
next in interface TemplateListModelpublic void rewind()
rewind in interface TemplateListModelpublic boolean isRewound()
isRewound in interface TemplateListModeltrue if we are at the beginning of the list,
otherwise falsepublic TemplateModel get(int index)
get in interface TemplateListModelindex - the index of the item to be retrieved
public TemplateModel get(java.lang.String key)
throws TemplateModelException
get in interface TemplateHashModelkey - the name of the value to be retrieved
null
TemplateModelException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||