| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_281) on Sun Jan 15 15:58:35 CET 2023 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>SimpleCollection (FreeMarker 2.3.32 API)</title> |
| <meta name="date" content="2023-01-15"> |
| <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="SimpleCollection (FreeMarker 2.3.32 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/SimpleCollection.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../freemarker/template/ResourceBundleLocalizedString.html" title="class in freemarker.template"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../freemarker/template/SimpleDate.html" title="class in freemarker.template"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?freemarker/template/SimpleCollection.html" target="_top">Frames</a></li> |
| <li><a href="SimpleCollection.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">freemarker.template</div> |
| <h2 title="Class SimpleCollection" class="title">Class SimpleCollection</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../freemarker/template/WrappingTemplateModel.html" title="class in freemarker.template">freemarker.template.WrappingTemplateModel</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>freemarker.template.SimpleCollection</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a>, <a href="../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a>, java.io.Serializable</dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">SimpleCollection</span> |
| extends <a href="../../freemarker/template/WrappingTemplateModel.html" title="class in freemarker.template">WrappingTemplateModel</a> |
| implements <a href="../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a>, java.io.Serializable</pre> |
| <div class="block">A simple implementation of <a href="../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template"><code>TemplateCollectionModel</code></a>. |
| It's able to wrap <tt>java.util.Iterator</tt>-s and <tt>java.util.Collection</tt>-s. |
| If you wrap an <tt>Iterator</tt>, the variable can be <#list>-ed only once! |
| |
| <p>Consider using <a href="../../freemarker/template/SimpleSequence.html" title="class in freemarker.template"><code>SimpleSequence</code></a> instead of this class if you want to wrap <tt>Iterator</tt>s. |
| <tt>SimpleSequence</tt> will read all elements of the <tt>Iterator</tt>, and store them in a <tt>List</tt> |
| (this may cause too high resource consumption in some applications), so you can list the variable |
| for unlimited times. Also, if you want to wrap <tt>Collection</tt>s, and then list the resulting |
| variable for many times, <tt>SimpleSequence</tt> may gives better performance, as the |
| wrapping of non-<tt>TemplateModel</tt> objects happens only once. |
| |
| <p>This class is thread-safe. The returned <a href="../../freemarker/template/TemplateModelIterator.html" title="interface in freemarker.template"><code>TemplateModelIterator</code></a>-s |
| are <em>not</em> thread-safe.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../serialized-form.html#freemarker.template.SimpleCollection">Serialized Form</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.freemarker.template.TemplateModel"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from interface freemarker.template.<a href="../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></h3> |
| <code><a href="../../freemarker/template/TemplateModel.html#NOTHING">NOTHING</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Collection-">SimpleCollection</a></span>(java.util.Collection collection)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a> instead.</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Collection-freemarker.template.ObjectWrapper-">SimpleCollection</a></span>(java.util.Collection collection, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</code> |
| <div class="block">Same as <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a>; kept for binary compatibility.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-">SimpleCollection</a></span>(java.lang.Iterable iterable)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a> instead.</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-">SimpleCollection</a></span>(java.lang.Iterable iterable, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Iterator-">SimpleCollection</a></span>(java.util.Iterator iterator)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Iterator-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterator, ObjectWrapper)</code></a></span></div> |
| </div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Iterator-freemarker.template.ObjectWrapper-">SimpleCollection</a></span>(java.util.Iterator iterator, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="../../freemarker/template/TemplateModelIterator.html" title="interface in freemarker.template">TemplateModelIterator</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../freemarker/template/SimpleCollection.html#iterator--">iterator</a></span>()</code> |
| <div class="block">Retrieves a template model iterator that is used to iterate over the elements in this collection.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.freemarker.template.WrappingTemplateModel"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class freemarker.template.<a href="../../freemarker/template/WrappingTemplateModel.html" title="class in freemarker.template">WrappingTemplateModel</a></h3> |
| <code><a href="../../freemarker/template/WrappingTemplateModel.html#getDefaultObjectWrapper--">getDefaultObjectWrapper</a>, <a href="../../freemarker/template/WrappingTemplateModel.html#getObjectWrapper--">getObjectWrapper</a>, <a href="../../freemarker/template/WrappingTemplateModel.html#setDefaultObjectWrapper-freemarker.template.ObjectWrapper-">setDefaultObjectWrapper</a>, <a href="../../freemarker/template/WrappingTemplateModel.html#setObjectWrapper-freemarker.template.ObjectWrapper-">setObjectWrapper</a>, <a href="../../freemarker/template/WrappingTemplateModel.html#wrap-java.lang.Object-">wrap</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="SimpleCollection-java.util.Iterator-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>@Deprecated |
| public SimpleCollection(java.util.Iterator iterator)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.util.Iterator-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterator, ObjectWrapper)</code></a></span></div> |
| </li> |
| </ul> |
| <a name="SimpleCollection-java.lang.Iterable-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>@Deprecated |
| public SimpleCollection(java.lang.Iterable iterable)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a> instead.</span></div> |
| </li> |
| </ul> |
| <a name="SimpleCollection-java.util.Collection-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>@Deprecated |
| public SimpleCollection(java.util.Collection collection)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Use <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a> instead.</span></div> |
| <div class="block">Same as <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-"><code>SimpleCollection(Iterable)</code></a>; kept for binary compatibility.</div> |
| </li> |
| </ul> |
| <a name="SimpleCollection-java.util.Collection-freemarker.template.ObjectWrapper-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>public SimpleCollection(java.util.Collection collection, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</pre> |
| <div class="block">Same as <a href="../../freemarker/template/SimpleCollection.html#SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"><code>SimpleCollection(Iterable, ObjectWrapper)</code></a>; kept for binary compatibility.</div> |
| </li> |
| </ul> |
| <a name="SimpleCollection-java.util.Iterator-freemarker.template.ObjectWrapper-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>public SimpleCollection(java.util.Iterator iterator, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</pre> |
| </li> |
| </ul> |
| <a name="SimpleCollection-java.lang.Iterable-freemarker.template.ObjectWrapper-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>SimpleCollection</h4> |
| <pre>public SimpleCollection(java.lang.Iterable iterable, |
| <a href="../../freemarker/template/ObjectWrapper.html" title="interface in freemarker.template">ObjectWrapper</a> wrapper)</pre> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>iterable</code> - Note that this was a <code>Collection</code> before 2.3.27, not an <code>Iterable</code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="iterator--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>iterator</h4> |
| <pre>public <a href="../../freemarker/template/TemplateModelIterator.html" title="interface in freemarker.template">TemplateModelIterator</a> iterator()</pre> |
| <div class="block">Retrieves a template model iterator that is used to iterate over the elements in this collection. |
| |
| <p>When you wrap an <tt>Iterator</tt> and you get <tt>TemplateModelIterator</tt> for multiple times, |
| only on of the returned <tt>TemplateModelIterator</tt> instances can be really used. When you have called a |
| method of a <tt>TemplateModelIterator</tt> instance, all other instance will throw a |
| <tt>TemplateModelException</tt> when you try to call their methods, since the wrapped <tt>Iterator</tt> |
| can't return the first element anymore.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../freemarker/template/TemplateCollectionModel.html#iterator--">iterator</a></code> in interface <code><a href="../../freemarker/template/TemplateCollectionModel.html" title="interface in freemarker.template">TemplateCollectionModel</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/SimpleCollection.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../freemarker/template/ResourceBundleLocalizedString.html" title="class in freemarker.template"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../freemarker/template/SimpleDate.html" title="class in freemarker.template"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?freemarker/template/SimpleCollection.html" target="_top">Frames</a></li> |
| <li><a href="SimpleCollection.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |