freemarker.ext.jdom
Class NodeListIterator

java.lang.Object
  |
  +--freemarker.ext.jdom.NodeListIterator
All Implemented Interfaces:
TemplateIteratorModel, TemplateModel

public class NodeListIterator
extends java.lang.Object
implements TemplateIteratorModel

Iterator model for NodeListModel. This implements a thread-safe iterator over JDOM lists.

Since:
1.8
Version:
$Id: NodeListIterator.java,v 1.3 2003/11/03 03:33:31 run2000 Exp $

Method Summary
 boolean hasNext()
          Returns true if nodes can be returned by a call to next().
 boolean isEmpty()
          Is the object empty?
 TemplateModel next()
          Returns the next node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Returns true if nodes can be returned by a call to next().
Specified by:
hasNext in interface TemplateIteratorModel
Following copied from interface: freemarker.template.TemplateIteratorModel
Returns:
true if there are more items to be iterated over, otherwise false
Throws:
TemplateModelException - there was a problem determining the next item in the list

next

public TemplateModel next()
Returns the next node.
Specified by:
next in interface TemplateIteratorModel
Following copied from interface: freemarker.template.TemplateIteratorModel
Returns:
the next item in the list
Throws:
TemplateModelException - the next item couldn't be retrieved, or we're at the end of the list

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Is the object empty?
Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty, otherwise false