freemarker.testcase.models
Class MultiModel4
java.lang.Object
|
+--freemarker.testcase.models.MultiModel4
- All Implemented Interfaces:
- TemplateHashModel, TemplateIndexedModel, TemplateListModel2, TemplateModel
- public final class MultiModel4
- extends java.lang.Object
- implements TemplateListModel2, TemplateIndexedModel, TemplateHashModel
Testcase to see how FM-Classic deals with multiple Template models.
- Version:
- $Id: MultiModel4.java,v 1.12 2003/11/28 01:17:07 run2000 Exp $
- See Also:
MultiModel1
,
MultiModel2
,
MultiModel3
,
MultiModel5
Constructor Summary |
MultiModel4()
Creates new MultiModel4. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiModel4
public MultiModel4()
- Creates new MultiModel4.
templateIterator
public TemplateIteratorModel templateIterator()
throws TemplateModelException
- Retrieves an iterator to iterate over this list.
- Specified by:
templateIterator
in interface TemplateListModel2
- Returns:
- an iterator to iterate over the current list.
- Throws:
TemplateModelException
- the next item in the list can't be
retrieved, or no next item exists.
releaseIterator
public void releaseIterator(TemplateIteratorModel iterator)
- Returns the used iterator to the list model.
- Specified by:
releaseIterator
in interface TemplateListModel2
- Parameters:
iterator
- the iterator to be returned to the object pool
getAtIndex
public TemplateModel getAtIndex(long index)
throws TemplateModelException
- Retrieves the specified item from the list.
- Specified by:
getAtIndex
in interface TemplateIndexedModel
- Parameters:
index
- the index of the item to be retrieved.- Returns:
- the specified index in the list.
- Throws:
TemplateModelException
- the specified item in the list can't be
retrieved, or the index is out of bounds.
isEmpty
public boolean isEmpty()
throws TemplateModelException
- Is the model empty?
- Specified by:
isEmpty
in interface TemplateModel
- Returns:
true
if the object is empty, otherwise false
.
get
public TemplateModel get(java.lang.String key)
throws TemplateModelException
- Gets the specified
TemplateModel
from the hash.
- Specified by:
get
in interface TemplateHashModel
- Parameters:
key
- the name by which the TemplateModel
is identified in the template.- Returns:
- the
TemplateModel
referred to by the key,
or null
if not found.