freemarker.doc
Class ContentList
java.lang.Object
|
+--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,v 1.8 2003/11/28 01:21:44 run2000 Exp $
Constructor Summary |
ContentList()
Creates a new ContentList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContentList
public ContentList()
- Creates a new ContentList
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
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
add
public void add(ContentEntry entry)
- Adds a new entry to the list.
- Parameters:
entry
- the ContentEntry
to be added