Java Doc for SimpleSequence.java in  » Template-Engine » freemarker-2.3.10 » freemarker » template » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Template Engine » freemarker 2.3.10 » freemarker.template 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   freemarker.template.WrappingTemplateModel
      freemarker.template.SimpleSequence

All known Subclasses:   freemarker.ext.dom.NodeListModel,  freemarker.template.SimpleList,  freemarker.testcase.models.LegacyList,
SimpleSequence
public class SimpleSequence extends WrappingTemplateModel implements TemplateSequenceModel,Serializable(Code)

A convenient implementation of a list. This object implements TemplateSequenceModel , using an underlying java.util.List implementation.

A SimpleSequence can act as a cache for a TemplateCollectionModel, e.g. one that gets data from a database. When passed a TemplateCollectionModel as an argument to its constructor, the SimpleSequence immediately copies all the elements and discards the TemplateCollectionModel.

This class is thread-safe if you don't call the add method after you have made the object available for multiple threads.

Note:
As of 2.0, this class is unsynchronized by default. To obtain a synchronized wrapper, call the SimpleSequence.synchronizedWrapper method.


version:
   $Id: SimpleSequence.java,v 1.53 2005/06/21 18:17:54 ddekany Exp $
See Also:   SimpleHash
See Also:   SimpleScalar


Field Summary
final protected  Listlist
    

Constructor Summary
public  SimpleSequence()
     Constructs an empty simple sequence that will use the the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .
public  SimpleSequence(int capacity)
     Constructs an empty simple sequence with preallocated capacity and using the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .
public  SimpleSequence(Collection collection)
     Constructs a simple sequence that will contain the elements from the specified Collection and will use the the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .
Parameters:
  collection - the collection containing initial values.
public  SimpleSequence(TemplateCollectionModel tcm)
     Constructs a simple sequence from the passed collection model using the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .
public  SimpleSequence(ObjectWrapper wrapper)
     Constructs an empty simple sequence using the specified object wrapper.
Parameters:
  wrapper - The object wrapper to use to wrap objects intoTemplateModel instances.
public  SimpleSequence(Collection collection, ObjectWrapper wrapper)
     Constructs a simple sequence that will contain the elements from the specified Collection and will use the specified object wrapper.
Parameters:
  collection - the collection containing initial values.

Method Summary
public  voidadd(Object obj)
     Adds an arbitrary object to the end of this SimpleSequence.
public  voidadd(boolean b)
     Adds a boolean to the end of this SimpleSequence, by coercing the boolean into TemplateBooleanModel.TRUE or TemplateBooleanModel.FALSE .
public  TemplateModelget(int i)
    
public  intsize()
    
public  SimpleSequencesynchronizedWrapper()
    
public  ListtoList()
     Note that this method creates and returns a deep-copy of the underlying list used internally.
public  StringtoString()
    

Field Detail
list
final protected List list(Code)




Constructor Detail
SimpleSequence
public SimpleSequence()(Code)
Constructs an empty simple sequence that will use the the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .



SimpleSequence
public SimpleSequence(int capacity)(Code)
Constructs an empty simple sequence with preallocated capacity and using the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .



SimpleSequence
public SimpleSequence(Collection collection)(Code)
Constructs a simple sequence that will contain the elements from the specified Collection and will use the the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .
Parameters:
  collection - the collection containing initial values. Note that acopy of the collection is made for internal use.



SimpleSequence
public SimpleSequence(TemplateCollectionModel tcm) throws TemplateModelException(Code)
Constructs a simple sequence from the passed collection model using the default object wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) .



SimpleSequence
public SimpleSequence(ObjectWrapper wrapper)(Code)
Constructs an empty simple sequence using the specified object wrapper.
Parameters:
  wrapper - The object wrapper to use to wrap objects intoTemplateModel instances. If null, the default wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) isused.



SimpleSequence
public SimpleSequence(Collection collection, ObjectWrapper wrapper)(Code)
Constructs a simple sequence that will contain the elements from the specified Collection and will use the specified object wrapper.
Parameters:
  collection - the collection containing initial values. Note that acopy of the collection is made for internal use.
Parameters:
  wrapper - The object wrapper to use to wrap objects intoTemplateModel instances. If null, the default wrapper set in WrappingTemplateModel.setDefaultObjectWrapper(ObjectWrapper) isused.




Method Detail
add
public void add(Object obj)(Code)
Adds an arbitrary object to the end of this SimpleSequence. If the object itself does not implement the TemplateModel interface, it will be wrapped into an appropriate adapter on the first call to SimpleSequence.get(int) .
Parameters:
  obj - the boolean to be added.



add
public void add(boolean b)(Code)
Adds a boolean to the end of this SimpleSequence, by coercing the boolean into TemplateBooleanModel.TRUE or TemplateBooleanModel.FALSE .
Parameters:
  b - the boolean to be added.



get
public TemplateModel get(int i) throws TemplateModelException(Code)
the specified index in the list



size
public int size()(Code)



synchronizedWrapper
public SimpleSequence synchronizedWrapper()(Code)
a synchronized wrapper for list.



toList
public List toList() throws TemplateModelException(Code)
Note that this method creates and returns a deep-copy of the underlying list used internally. This could be a gotcha for some people at some point who want to alter something in the data model, but we should maintain our immutability semantics (at least using default SimpleXXX wrappers) for the data model. It will recursively unwrap the stuff in the underlying container.



toString
public String toString()(Code)



Methods inherited from freemarker.template.WrappingTemplateModel
public static ObjectWrapper getDefaultObjectWrapper()(Code)(Java Doc)
public ObjectWrapper getObjectWrapper()(Code)(Java Doc)
public static void setDefaultObjectWrapper(ObjectWrapper objectWrapper)(Code)(Java Doc)
public void setObjectWrapper(ObjectWrapper objectWrapper)(Code)(Java Doc)
final protected TemplateModel wrap(Object obj) throws TemplateModelException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.