freemarker.template
Interface TemplateIndexedModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
ArrayModel, ContentList, FastList, FastListRange, ListModel, NodeListModel, SimpleList, BooleanList1, BooleanList2, MultiModel1, IndexedModel1, MultiModel4, MultiModel5

public interface TemplateIndexedModel
extends TemplateModel

Values that can be indexed by a numeric value must implement this interface. This interface replaces the get method in TemplateListModel.

The contract of this interface is general enough that an index need not start at any particular place, be sequential, or be limited in size, other than the limits given by TemplateNumberModel (a 64-bit signed integer).

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

Method Summary
 TemplateModel getAtIndex(long index)
          Get the value corresponding to the given index.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

getAtIndex

public TemplateModel getAtIndex(long index)
                         throws TemplateModelException
Get the value corresponding to the given index. Traditionally this would correspond to an index into an array, or similar structure, such as a java.util.Vector.
Parameters:
index - the index of the underlying value we're interested in
Returns:
a TemplateModel representing the value for the given index
Throws:
TemplateModelException - the value could not be determined, possibly due to an index out-of-bounds, or an otherwise undefined value