Java Doc for CollectionUtils.java in  » J2EE » spring-framework-2.5 » org » springframework » 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 » J2EE » spring framework 2.5 » org.springframework.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.util.CollectionUtils

CollectionUtils
abstract public class CollectionUtils (Code)
Miscellaneous collection utility methods. Mainly for internal use within the framework.
author:
   Juergen Hoeller
author:
   Rob Harrop
since:
   1.1.3




Method Summary
public static  ListarrayToList(Object source)
     Convert the supplied array into a List.
public static  booleancontains(Iterator iterator, Object element)
     Check whether the given Iterator contains the given element.
public static  booleancontains(Enumeration enumeration, Object element)
     Check whether the given Enumeration contains the given element.
public static  booleancontainsAny(Collection source, Collection candidates)
     Return true if any element in 'candidates' is contained in 'source'; otherwise returns false.
public static  booleancontainsInstance(Collection collection, Object element)
     Check whether the given Collection contains the given element instance.
public static  ObjectfindFirstMatch(Collection source, Collection candidates)
     Return the first element in 'candidates' that is contained in 'source'.
public static  ObjectfindValueOfType(Collection collection, Class type)
     Find a value of the given type in the given Collection.
public static  ObjectfindValueOfType(Collection collection, Class[] types)
     Find a value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.
public static  booleanhasUniqueObject(Collection collection)
     Determine whether the given Collection only contains a single unique object.
public static  booleanisEmpty(Collection collection)
     Return true if the supplied Collection is null or empty.
public static  booleanisEmpty(Map map)
     Return true if the supplied Map is null or empty.
public static  voidmergeArrayIntoCollection(Object array, Collection collection)
     Merge the given array into the given Collection.
public static  voidmergePropertiesIntoMap(Properties props, Map map)
     Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over.



Method Detail
arrayToList
public static List arrayToList(Object source)(Code)
Convert the supplied array into a List. A primitive array gets converted into a List of the appropriate wrapper type.

A null source value will be converted to an empty List.
Parameters:
  source - the (potentially primitive) array the converted List result
See Also:   ObjectUtils.toObjectArray(Object)




contains
public static boolean contains(Iterator iterator, Object element)(Code)
Check whether the given Iterator contains the given element.
Parameters:
  iterator - the Iterator to check
Parameters:
  element - the element to look for true if found, false else



contains
public static boolean contains(Enumeration enumeration, Object element)(Code)
Check whether the given Enumeration contains the given element.
Parameters:
  enumeration - the Enumeration to check
Parameters:
  element - the element to look for true if found, false else



containsAny
public static boolean containsAny(Collection source, Collection candidates)(Code)
Return true if any element in 'candidates' is contained in 'source'; otherwise returns false.
Parameters:
  source - the source Collection
Parameters:
  candidates - the candidates to search for whether any of the candidates has been found



containsInstance
public static boolean containsInstance(Collection collection, Object element)(Code)
Check whether the given Collection contains the given element instance.

Enforces the given instance to be present, rather than returning true for an equal element as well.
Parameters:
  collection - the Collection to check
Parameters:
  element - the element to look for true if found, false else




findFirstMatch
public static Object findFirstMatch(Collection source, Collection candidates)(Code)
Return the first element in 'candidates' that is contained in 'source'. If no element in 'candidates' is present in 'source' returns null. Iteration order is Collection implementation specific.
Parameters:
  source - the source Collection
Parameters:
  candidates - the candidates to search for the first present object, or null if not found



findValueOfType
public static Object findValueOfType(Collection collection, Class type) throws IllegalArgumentException(Code)
Find a value of the given type in the given Collection.
Parameters:
  collection - the Collection to search
Parameters:
  type - the type to look for a value of the given type found, or null if none
throws:
  IllegalArgumentException - if more than one value of the given type found



findValueOfType
public static Object findValueOfType(Collection collection, Class[] types) throws IllegalArgumentException(Code)
Find a value of one of the given types in the given Collection: searching the Collection for a value of the first type, then searching for a value of the second type, etc.
Parameters:
  collection - the collection to search
Parameters:
  types - the types to look for, in prioritized order a of one of the given types found, or null if none
throws:
  IllegalArgumentException - if more than one value of the given type found



hasUniqueObject
public static boolean hasUniqueObject(Collection collection)(Code)
Determine whether the given Collection only contains a single unique object.
Parameters:
  collection - the Collection to check true if the collection contains a single reference ormultiple references to the same instance, false else



isEmpty
public static boolean isEmpty(Collection collection)(Code)
Return true if the supplied Collection is null or empty. Otherwise, return false.
Parameters:
  collection - the Collection to check whether the given Collection is empty



isEmpty
public static boolean isEmpty(Map map)(Code)
Return true if the supplied Map is null or empty. Otherwise, return false.
Parameters:
  map - the Map to check whether the given Map is empty



mergeArrayIntoCollection
public static void mergeArrayIntoCollection(Object array, Collection collection)(Code)
Merge the given array into the given Collection.
Parameters:
  array - the array to merge (may be null)
Parameters:
  collection - the target Collection to merge the array into



mergePropertiesIntoMap
public static void mergePropertiesIntoMap(Properties props, Map map)(Code)
Merge the given Properties instance into the given Map, copying all properties (key-value pairs) over.

Uses Properties.propertyNames() to even catch default properties linked into the original Properties instance.
Parameters:
  props - the Properties instance to merge (may be null)
Parameters:
  map - the target Map to merge the properties into




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.