freemarker.testcase.models

Class MultiModel4

Implemented Interfaces:
TemplateHashModel, TemplateModel, TemplateSequenceModel

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

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

Fields inherited from interface freemarker.template.TemplateModel

NOTHING

Method Summary

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

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

size

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