|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.FastList
An unsynchronized variation of the SimpleList
class.
This allows FastList
to be significantly faster than
SimpleList
in some cases.
Note that every template process is performed synchronously, so within a single-threaded application instances of this class will always be safe.
Note also that this class was retrofitted with the TemplateListModel2
interface as of 1.8.
FastBoolean
,
FastHash
,
FastNumber
,
FastScalar
, Serialized FormConstructor Summary | |
FastList()
Constructs an empty FastList . |
|
FastList(java.util.List list)
Constructs a FastList from the given List . |
Method Summary | |
boolean |
equals(java.lang.Object o)
Tests this object for equality with the given object. |
java.lang.Object |
getAsObject()
Return an unmodifiable view of the underlying List
object for manipulation by the freemarker.ext.beans
package. |
TemplateModel |
getAtIndex(long index)
Retrieves the specified item from the list. |
int |
hashCode()
Return the hash value for this object. |
boolean |
isEmpty()
Is the underlying List empty? |
void |
releaseIterator(TemplateIteratorModel iterator)
Returns the used iterator to the list model. |
TemplateIteratorModel |
templateIterator()
Retrieves an iterator to iterate over this list. |
java.lang.String |
toString()
Returns a String representation of the object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FastList()
FastList
.public FastList(java.util.List list)
FastList
from the given List
.NullPointerException
- the list value is nullMethod Detail |
public boolean isEmpty() throws TemplateModelException
List
empty?isEmpty
in interface TemplateModel
true
if the list is empty, otherwise false
public TemplateIteratorModel templateIterator() throws TemplateModelException
templateIterator
in interface TemplateListModel2
TemplateModelException
- the next item in the list can't be
retrieved, or no next item exists.public void releaseIterator(TemplateIteratorModel iterator)
releaseIterator
in interface TemplateListModel2
iterator
- the iterator to be returned to the object pool, if anypublic TemplateModel getAtIndex(long index) throws TemplateModelException
getAtIndex
in interface TemplateIndexedModel
index
- the index of the item to be retrieved.TemplateModelException
- the specified item in the list can't be
retrieved, or the index is out of bounds.public java.lang.Object getAsObject() throws TemplateModelException
Return an unmodifiable view of the underlying List
object for manipulation by the freemarker.ext.beans
package.
getAsObject
in interface TemplateObjectModel
List
objectpublic java.lang.String toString()
String
representation of the object.toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared withtrue
if the objects are equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |