freemarker.template
Interface TemplateListModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
ListModel2

Deprecated. This interface is not multi-thread safe, and also, in some cases, not single-thread safe either. Use the TemplateListModel2 interface instead.

public interface TemplateListModel
extends TemplateModel

List values in a template data model must implement this interface, which is essentially the Iterator interface plus a rewind() method that allows the list to be read again. As of 1.5.3, there is also a get(int) method that allows the list to be accessed in a random-access fashion.

The detail messages of any TemplateModelExceptions thrown will be included as HTML comments in the output.

Version:
$Id: TemplateListModel.java,v 1.10 2003/11/03 03:33:32 run2000 Exp $
See Also:
TemplateListModel2, TemplateIndexedModel

Method Summary
 TemplateModel get(int index)
          Deprecated. Retrieves the specified item from the list.
 boolean hasNext()
          Deprecated. Is there a next item in the list?
 boolean isRewound()
          Deprecated. Is the cursor at the beginning of the list?
 TemplateModel next()
          Deprecated. Retrieves the next item in the list.
 void rewind()
          Deprecated. Resets the cursor to the beginning of the list.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

rewind

public void rewind()
            throws TemplateModelException
Deprecated. 
Resets the cursor to the beginning of the list.

isRewound

public boolean isRewound()
                  throws TemplateModelException
Deprecated. 
Is the cursor at the beginning of the list?
Returns:
true if the cursor is at the beginning of the list, otherwise false.

hasNext

public boolean hasNext()
                throws TemplateModelException
Deprecated. 
Is there a next item in the list?
Returns:
true if there is a next element, otherwise false.

next

public TemplateModel next()
                   throws TemplateModelException
Deprecated. 
Retrieves the next item in the list.
Returns:
the next element in the list.
Throws:
TemplateModelException - the next item in the list can't be retrieved, or no next item exists.

get

public TemplateModel get(int index)
                  throws TemplateModelException
Deprecated. 
Retrieves the specified item from the list.
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.
Since:
1.5.3