java.lang.Object | |
↳ | org.springframework.core.CollectionFactory |
Factory for collections, being aware of Java 5 and Java 6 collections. Mainly for internal use within the framework.
The goal of this class is to avoid runtime dependencies on a specific Java version, while nevertheless using the best collection implementation that is available at runtime.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create the most approximate collection for the given collection.
| |||||||||||
Create the most approximate map for the given map.
| |||||||||||
Create the most appropriate collection for the given collection type.
| |||||||||||
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
| |||||||||||
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
| |||||||||||
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
| |||||||||||
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
| |||||||||||
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
| |||||||||||
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
| |||||||||||
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
| |||||||||||
Create the most approximate map for the given map.
| |||||||||||
Determine whether the given collection type is an approximable type,
i.e.
| |||||||||||
Determine whether the given map type is an approximable type,
i.e.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create the most approximate collection for the given collection.
Creates an ArrayList, TreeSet or linked Set for a List, SortedSet or Set, respectively.
collection | the original Collection object |
---|---|
initialCapacity | the initial capacity |
Create the most approximate map for the given map.
Creates a TreeMap or linked Map for a SortedMap or Map, respectively.
map | the original Map object |
---|---|
initialCapacity | the initial capacity |
LinkedHashMap
Create the most appropriate collection for the given collection type.
Creates an ArrayList, TreeSet or linked Set for a List, SortedSet or Set, respectively.
collectionType | the desired type of the target Collection |
---|---|
initialCapacity | the initial capacity |
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
Create a concurrent Map with a dedicated ConcurrentMap
interface:
This implementation always creates a java.util.concurrent.ConcurrentHashMap,
since Spring 3.0 requires JDK 1.5 anyway.
initialCapacity | the initial capacity of the Map |
---|
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
Create a concurrent Map if possible: This implementation always creates a java.util.concurrent.ConcurrentHashMap, since Spring 3.0 requires JDK 1.5 anyway.
initialCapacity | the initial capacity of the Map |
---|
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
Create a copy-on-write Set (allowing for synchronization-less iteration) if possible: This implementation always creates a java.util.concurrent.CopyOnWriteArraySet, since Spring 3 requires JDK 1.5 anyway.
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
Create an identity Map if possible: This implementation always creates a java.util.IdentityHashMap, since Spring 2.5 requires JDK 1.4 anyway.
initialCapacity | the initial capacity of the Map |
---|
This method is deprecated.
as of Spring 3.0, for usage on JDK 1.5 or higher
Create a linked case-insensitive Map if possible: This implementation
always returns a LinkedCaseInsensitiveMap
.
initialCapacity | the initial capacity of the Map |
---|
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
Create a linked Map if possible: This implementation always
creates a LinkedHashMap
, since Spring 2.5
requires JDK 1.4 anyway.
initialCapacity | the initial capacity of the Map |
---|
This method is deprecated.
as of Spring 2.5, for usage on JDK 1.4 or higher
Create a linked Set if possible: This implementation always creates a java.util.LinkedHashSet, since Spring 2.5 requires JDK 1.4 anyway.
initialCapacity | the initial capacity of the Set |
---|
Create the most approximate map for the given map.
Creates a TreeMap or linked Map for a SortedMap or Map, respectively.
initialCapacity | the initial capacity |
---|
LinkedHashMap
Determine whether the given collection type is an approximable type,
i.e. a type that createApproximateCollection(Object, int)
can approximate.
collectionType | the collection type to check |
---|
true
if the type is approximable,
false
if it is not
Determine whether the given map type is an approximable type,
i.e. a type that createApproximateMap(Object, int)
can approximate.
mapType | the map type to check |
---|
true
if the type is approximable,
false
if it is not