Java Doc for LazyList.java in  » Sevlet-Container » jetty-modules » org » mortbay » util » 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 » Sevlet Container » jetty modules » org.mortbay.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mortbay.util.LazyList

LazyList
public class LazyList implements Cloneable,Serializable(Code)
Lazy List creation. A List helper class that attempts to avoid unneccessary List creation. If a method needs to create a List to return, but it is expected that this will either be empty or frequently contain a single item, then using LazyList will avoid additional object creations by using Collections.EMPTY_LIST or Collections.singletonList where possible.

Usage

 Object lazylist =null;
 while(loopCondition)
 {
 Object item = getItem();
 if (item.isToBeAdded())
 lazylist = LazyList.add(lazylist,item);
 }
 return LazyList.getList(lazylist);
 
An ArrayList of default size is used as the initial LazyList.
See Also:   java.util.List
author:
   Greg Wilkins (gregw)




Method Summary
public static  Objectadd(Object list, Object item)
     Add an item to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  item - The item to add.
public static  Objectadd(Object list, int index, Object item)
     Add an item to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  index - The index to add the item at.
Parameters:
  item - The item to add.
public static  ObjectaddArray(Object list, Object[] array)
     Add the contents of an array to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  collection - The Collection whose contents should be added.
public static  ObjectaddCollection(Object list, Collection collection)
     Add the contents of a Collection to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  collection - The Collection whose contents should be added.
public static  Object[]addToArray(Object[] array, Object item, Class type)
    
public static  Listarray2List(Object[] array)
    
public static  Objectclone(Object list)
    
public static  booleancontains(Object list, Object item)
    
public static  ObjectensureSize(Object list, int initialSize)
     Ensure the capcity of the underlying list.
public static  Objectget(Object list, int i)
    
public static  ListgetList(Object list)
     Get the real List from a LazyList.
public static  ListgetList(Object list, boolean nullForEmpty)
     Get the real List from a LazyList.
Parameters:
  list - A LazyList returned from LazyList.add(Object) or null
Parameters:
  nullForEmpty - If true, null is returned instead of anempty list.
public static  Iteratoriterator(Object list)
    
public static  ListIteratorlistIterator(Object list)
    
public static  Objectremove(Object list, Object o)
    
public static  Objectremove(Object list, int i)
    
public static  Object[]removeFromArray(Object[] array, Object item)
    
public static  intsize(Object list)
    
public static  ObjecttoArray(Object list, Class aClass)
    
public static  StringtoString(Object list)
    
public static  String[]toStringArray(Object list)
    



Method Detail
add
public static Object add(Object list, Object item)(Code)
Add an item to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  item - The item to add. The lazylist created or added to.



add
public static Object add(Object list, int index, Object item)(Code)
Add an item to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  index - The index to add the item at.
Parameters:
  item - The item to add. The lazylist created or added to.



addArray
public static Object addArray(Object list, Object[] array)(Code)
Add the contents of an array to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  collection - The Collection whose contents should be added. The lazylist created or added to.



addCollection
public static Object addCollection(Object list, Collection collection)(Code)
Add the contents of a Collection to a LazyList
Parameters:
  list - The list to add to or null if none yet created.
Parameters:
  collection - The Collection whose contents should be added. The lazylist created or added to.



addToArray
public static Object[] addToArray(Object[] array, Object item, Class type)(Code)
Add element to an array
Parameters:
  array - The array to add to (or null)
Parameters:
  item - The item to add
Parameters:
  type - The type of the array (in case of null array) new array with contents of array plus item



array2List
public static List array2List(Object[] array)(Code)

Parameters:
  array - Any array of object A new modifiable list initialised with the elements from array.



clone
public static Object clone(Object list)(Code)



contains
public static boolean contains(Object list, Object item)(Code)



ensureSize
public static Object ensureSize(Object list, int initialSize)(Code)
Ensure the capcity of the underlying list.



get
public static Object get(Object list, int i)(Code)
Get item from the list
Parameters:
  list - A LazyList returned from LazyList.add(Object) or null
Parameters:
  i - int index the item from the list.



getList
public static List getList(Object list)(Code)
Get the real List from a LazyList.
Parameters:
  list - A LazyList returned from LazyList.add(Object) The List of added items, which may be an EMPTY_LISTor a SingletonList.



getList
public static List getList(Object list, boolean nullForEmpty)(Code)
Get the real List from a LazyList.
Parameters:
  list - A LazyList returned from LazyList.add(Object) or null
Parameters:
  nullForEmpty - If true, null is returned instead of anempty list. The List of added items, which may be null, an EMPTY_LISTor a SingletonList.



iterator
public static Iterator iterator(Object list)(Code)



listIterator
public static ListIterator listIterator(Object list)(Code)



remove
public static Object remove(Object list, Object o)(Code)



remove
public static Object remove(Object list, int i)(Code)



removeFromArray
public static Object[] removeFromArray(Object[] array, Object item)(Code)



size
public static int size(Object list)(Code)
The size of a lazy List
Parameters:
  list - A LazyList returned from LazyList.add(Object) or null the size of the list.



toArray
public static Object toArray(Object list, Class aClass)(Code)



toString
public static String toString(Object list)(Code)



toStringArray
public static String[] toStringArray(Object list)(Code)



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.