Class IndirectCollectionsFactory
- java.lang.Object
-
- org.eclipse.persistence.indirection.IndirectCollectionsFactory
-
public final class IndirectCollectionsFactory extends java.lang.Object
Provides factory methods to create JDK specific implementation of particular type ofIndirectCollection
.- See Also:
IndirectCollection
,IndirectList
,IndirectMap
,IndirectSet
- Author:
- Lukas Jungmann
- Since:
- EclipseLink 2.6.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IndirectCollectionsFactory.IndirectCollectionsProvider
Define API providers ofIndirectCollection
implementations must conform to.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class
IndirectList_Class
Class implementingIndirectList
.static java.lang.Class
IndirectMap_Class
Class implementingIndirectMap
.static java.lang.Class
IndirectSet_Class
Class implementingIndirectSet
.
-
Constructor Summary
Constructors Constructor Description IndirectCollectionsFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> IndirectList<E>
createIndirectList()
Construct an emptyIndirectList
with the default initial capacity (10) and default capacity increment (0).static <E> IndirectList<E>
createIndirectList(int initialCapacity)
Construct an emptyIndirectList
with the specified initial capacity and default capacity increment (0).static <E> IndirectList<E>
createIndirectList(java.util.Collection<? extends E> collection)
Construct anIndirectList
containing the elements of the specified collection, in the order they are returned by the collection's iterator.static <K,V>
IndirectMap<K,V>createIndirectMap()
Construct a new, emptyIndirectMap
with the default initial capacity (11) and the default load factor (0.75).static <K,V>
IndirectMap<K,V>createIndirectMap(int initialCapacity)
Construct a new, emptyIndirectMap
with the specified initial capacity and the default load factor (0.75).static <K,V>
IndirectMap<K,V>createIndirectMap(java.util.Map<? extends K,? extends V> map)
Construct a newIndirectMap
with the same mappings as the given Map.static <E> IndirectSet<E>
createIndirectSet()
Construct an emptyIndirectSet
with the default initial capacity (10) and the default load factor (0.75).static <E> IndirectSet<E>
createIndirectSet(int initialCapacity)
Construct an emptyIndirectSet
with the specified initial capacity and the default load factor (0.75).static <E> IndirectSet<E>
createIndirectSet(java.util.Collection<? extends E> collection)
Constructs anIndirectSet
containing the elements of the specified collection.
-
-
-
Field Detail
-
IndirectList_Class
public static final java.lang.Class IndirectList_Class
Class implementingIndirectList
.
-
IndirectSet_Class
public static final java.lang.Class IndirectSet_Class
Class implementingIndirectSet
.
-
IndirectMap_Class
public static final java.lang.Class IndirectMap_Class
Class implementingIndirectMap
.
-
-
Method Detail
-
createIndirectList
public static <E> IndirectList<E> createIndirectList()
Construct an emptyIndirectList
with the default initial capacity (10) and default capacity increment (0).- Type Parameters:
E
- the class of the objects in the list- Returns:
- an empty
IndirectList
with the default initial capacity and default capacity increment
-
createIndirectList
public static <E> IndirectList<E> createIndirectList(int initialCapacity)
Construct an emptyIndirectList
with the specified initial capacity and default capacity increment (0).- Type Parameters:
E
- the class of the objects in the list- Parameters:
initialCapacity
- the initial capacity of the vector- Returns:
- an empty
IndirectList
with the specified initial capacity and default capacity increment - Throws:
java.lang.IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectList
public static <E> IndirectList<E> createIndirectList(java.util.Collection<? extends E> collection)
Construct anIndirectList
containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Type Parameters:
E
- the class of the objects in the list- Parameters:
collection
- a collection containing the elements to construct theIndirectList
with.- Returns:
- an
IndirectList
containing the elements of the specified collection
-
createIndirectSet
public static <E> IndirectSet<E> createIndirectSet()
Construct an emptyIndirectSet
with the default initial capacity (10) and the default load factor (0.75).- Returns:
- an empty
IndirectSet
with the default initial capacity and the default load factor
-
createIndirectSet
public static <E> IndirectSet<E> createIndirectSet(int initialCapacity)
Construct an emptyIndirectSet
with the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity
- the initial capacity of the set- Returns:
- an empty
IndirectSet
with the specified initial capacity and the default load factor - Throws:
java.lang.IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectSet
public static <E> IndirectSet<E> createIndirectSet(java.util.Collection<? extends E> collection)
Constructs anIndirectSet
containing the elements of the specified collection.- Parameters:
collection
- a collection containing the elements to construct theIndirectSet
with- Returns:
- an
IndirectSet
containing the elements of the specified collection - Throws:
java.lang.NullPointerException
- if the specified collection is null
-
createIndirectMap
public static <K,V> IndirectMap<K,V> createIndirectMap()
Construct a new, emptyIndirectMap
with the default initial capacity (11) and the default load factor (0.75).- Returns:
- a new, empty
IndirectMap
with the default initial capacity and the default load factor
-
createIndirectMap
public static <K,V> IndirectMap<K,V> createIndirectMap(int initialCapacity)
Construct a new, emptyIndirectMap
with the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity
- the initial capacity of theIndirectMap
- Returns:
- a new, empty
IndirectMap
with the specified initial capacity and the default load factor - Throws:
java.lang.IllegalArgumentException
- if the initial capacity is less than or equal to zero
-
createIndirectMap
public static <K,V> IndirectMap<K,V> createIndirectMap(java.util.Map<? extends K,? extends V> map)
Construct a newIndirectMap
with the same mappings as the given Map. TheIndirectMap
is created with a capacity of twice the number of entries in the given Map or 11 (whichever is greater), and a default load factor, which is 0.75.- Parameters:
map
- the map whose mappings are to be placed into createdIndirectMap
- Returns:
- a new
IndirectMap
with the same mappings as the given Map - Throws:
java.lang.NullPointerException
- if the specified map is null
-
-