|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.FastList<T>
public final class FastList<T extends TemplateModel>
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<T> 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 |
putAtIndex(long index,
TemplateModel model)
Set the value corresponding to the given index. |
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<T> list)
FastList
from the given List
.
java.lang.NullPointerException
- the list value is nullMethod Detail |
---|
public boolean isEmpty()
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 void putAtIndex(long index, TemplateModel model) throws TemplateModelException
java.util.Vector
.
putAtIndex
in interface TemplateWriteableIndexedModel
index
- the index of the underlying value we're interested inmodel
- the model to be added to the list
TemplateModelException
- the value could not be determined, possibly
due to an index out-of-bounds, or an otherwise undefined valuepublic java.lang.Object getAsObject()
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 with
true
if the objects are equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |