freemarker.ext.jython
Class JythonSequenceModel

java.lang.Object
  extended byfreemarker.ext.jython.JythonModel
      extended byfreemarker.ext.jython.JythonSequenceModel
All Implemented Interfaces:
TemplateBooleanModel, TemplateCollectionModel, TemplateHashModel, TemplateMethodModel, TemplateMethodModelEx, TemplateModel, TemplateScalarModel, TemplateSequenceModel, WrapperTemplateModel

public class JythonSequenceModel
extends JythonModel
implements TemplateSequenceModel, TemplateCollectionModel

Model for Jython sequence objects (PySequence descendants).

Version:
$Id: JythonSequenceModel.java,v 1.13 2003/11/12 21:53:40 ddekany Exp $
Author:
Attila Szegedi

Field Summary
 
Fields inherited from class freemarker.ext.jython.JythonModel
object, wrapper
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Fields inherited from interface freemarker.template.TemplateBooleanModel
FALSE, TRUE
 
Fields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING
 
Constructor Summary
JythonSequenceModel(org.python.core.PyObject object, JythonWrapper wrapper)
           
 
Method Summary
 TemplateModel get(int index)
          Returns PyObject.__finditem__(int).
 TemplateModelIterator iterator()
          Retrieves a template model iterator that is used to iterate over the elements in this collection.
 int size()
          Returns PyObject.__len__().
 
Methods inherited from class freemarker.ext.jython.JythonModel
exec, get, getAsBoolean, getAsString, getWrappedObject, isEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JythonSequenceModel

public JythonSequenceModel(org.python.core.PyObject object,
                           JythonWrapper wrapper)
Method Detail

get

public TemplateModel get(int index)
                  throws TemplateModelException
Returns PyObject.__finditem__(int).

Specified by:
get in interface TemplateSequenceModel
Throws:
TemplateModelException

size

public int size()
         throws TemplateModelException
Returns PyObject.__len__().

Specified by:
size in interface TemplateSequenceModel
Returns:
the number of items in the list.
Throws:
TemplateModelException

iterator

public TemplateModelIterator iterator()
Description copied from interface: TemplateCollectionModel
Retrieves a template model iterator that is used to iterate over the elements in this collection.

Specified by:
iterator in interface TemplateCollectionModel