freemarker.testcase.models

Class MultiModel5

Implemented Interfaces:
TemplateHashModel, TemplateModel, TemplateSequenceModel

public class MultiModel5
extends java.lang.Object
implements TemplateSequenceModel, TemplateHashModel

Testcase to see how FreeMarker deals with multiple Template models.
Version:
$Id: MultiModel5.java,v 1.12 2004/01/06 17:06:44 szegedia Exp $

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Constructor Summary

MultiModel5()
Creates new MultiModel5

Method Summary

TemplateModel
get(String key)
Gets a TemplateModel from the hash.
TemplateModel
get(int i)
boolean
isEmpty()
int
size()

Constructor Details

MultiModel5

public MultiModel5()
Creates new MultiModel5

Method Details

get

public TemplateModel get(String key)
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.

get

public TemplateModel get(int i)
            throws TemplateModelException
Specified by:
get in interface TemplateSequenceModel
Returns:
the specified index in the list

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface TemplateHashModel
Returns:
true if this object is empty.

size

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