freemarker.template
Interface TemplateIndexedModel

All Superinterfaces:
TemplateModel
All Known Subinterfaces:
TemplateWriteableIndexedModel
All Known Implementing Classes:
ArrayModel, ArrayWrapper, ContentList, ExtendedList, FastList, FastListRange, IndexedPropertyWrapper, ListModel, ListWrapper, NodeListModel, SimpleList

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 1101 2013-04-01 04:17:32Z run2000 $
See Also:
TemplateListModel, TemplateWriteableIndexedModel

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

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