freemarker.ext.misc
Class ExtendedIterator

java.lang.Object
  extended by freemarker.template.FastIterator
      extended by freemarker.ext.misc.ExtendedIterator
All Implemented Interfaces:
TemplateHashModel, TemplateIteratorModel, TemplateModel

public class ExtendedIterator
extends FastIterator
implements TemplateHashModel

Iterator for the ExtendedList class. The most notable addition for this iterator is that ability to determine whether we're at the end of the list. This is done by implementing the TemplateHashModel interface as well as the standard TemplateIteratorModel interface.

Since:
1.8
Version:
$Id: ExtendedIterator.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull

Field Summary
 
Fields inherited from class freemarker.template.FastIterator
iterator
 
Constructor Summary
ExtendedIterator(java.util.List<? extends TemplateModel> list)
           
 
Method Summary
 TemplateModel get(java.lang.String key)
          Gets a TemplateModel from the hash.
 
Methods inherited from class freemarker.template.FastIterator
hasNext, isEmpty, next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Constructor Detail

ExtendedIterator

public ExtendedIterator(java.util.List<? extends TemplateModel> list)
Method Detail

get

public TemplateModel get(java.lang.String key)
                  throws TemplateModelException
Gets a 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.
Throws:
TemplateModelException - there was a problem getting the value for the given key