freemarker.doc
Class ContentList

java.lang.Object
  extended by freemarker.doc.ContentList
All Implemented Interfaces:
TemplateIndexedModel, TemplateListModel2, TemplateModel

public final class ContentList
extends java.lang.Object
implements TemplateListModel2, TemplateIndexedModel

Implements a list of table-of-contents entries.

Version:
$Id: ContentList.java 1101 2013-04-01 04:17:32Z run2000 $

Constructor Summary
ContentList()
          Creates a new ContentList
 
Method Summary
 void add(ContentEntry entry)
          Adds a new entry to the list.
 TemplateModel getAtIndex(long index)
          Retrieves the specified item from the list.
 boolean isEmpty()
          Is the list empty?
 void releaseIterator(TemplateIteratorModel iterator)
          Release an iterator for this content list.
 TemplateIteratorModel templateIterator()
          Retrieves an iterator to iterate over this content list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentList

public ContentList()
Creates a new ContentList

Method Detail

templateIterator

public TemplateIteratorModel templateIterator()
                                       throws TemplateModelException
Retrieves an iterator to iterate over this content list.

Specified by:
templateIterator in interface TemplateListModel2
Returns:
an iterator to iterate over the current content list
Throws:
TemplateModelException - the next item in the list can't be retrieved, or no next item exists.

releaseIterator

public void releaseIterator(TemplateIteratorModel iterator)
Release an iterator for this content list.

Specified by:
releaseIterator in interface TemplateListModel2
Parameters:
iterator - the iterator to be released

getAtIndex

public TemplateModel getAtIndex(long index)
                         throws TemplateModelException
Retrieves the specified item from the list.

Specified by:
getAtIndex in interface TemplateIndexedModel
Parameters:
index - the index of the item to be retrieved
Returns:
the specified index in the list
Throws:
TemplateModelException - the specified index is out of bounds

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Is the list empty?

Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty, otherwise false
Throws:
TemplateModelException

add

public void add(ContentEntry entry)
Adds a new entry to the list.

Parameters:
entry - the ContentEntry to be added