freemarker.template
Class TemplateModelListSequence

java.lang.Object
  extended by freemarker.template.TemplateModelListSequence
All Implemented Interfaces:
TemplateModel, TemplateSequenceModel

public class TemplateModelListSequence
extends java.lang.Object
implements TemplateSequenceModel

Sequence that wraps a java.util.List of already wrapped objects directly, with minimal resource usage. Warning! It does not copy the original list.

Version:
$Id: TemplateModelListSequence.java,v 1.2 2004/01/06 17:06:43 szegedia Exp $
Author:
Daniel Dekany

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
TemplateModelListSequence(java.util.List list)
           
 
Method Summary
 TemplateModel get(int index)
          Retrieves the i-th template model in this sequence.
 java.lang.Object getWrappedObject()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateModelListSequence

public TemplateModelListSequence(java.util.List list)
Method Detail

get

public TemplateModel get(int index)
Description copied from interface: TemplateSequenceModel
Retrieves the i-th template model in this sequence.

Specified by:
get in interface TemplateSequenceModel
Returns:
the item at the specified index, or null if the index is out of bounds. Note that a null value is interpreted by FreeMarker as "variable does not exist", and accessing a missing variables is usually considered as an error in the FreeMarker Template Language, so the usage of a bad index will not remain hidden.

size

public int size()
Specified by:
size in interface TemplateSequenceModel
Returns:
the number of items in the list.

getWrappedObject

public java.lang.Object getWrappedObject()