Class IndirectCollectionsFactory
java.lang.Object
org.eclipse.persistence.indirection.IndirectCollectionsFactory
Provides factory methods to create JDK specific implementation
of particular type of
IndirectCollection.- See Also:
- Author:
- Lukas Jungmann
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefine API providers ofIndirectCollectionimplementations must conform to. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassClass implementingIndirectList.static final ClassClass implementingIndirectMap.static final ClassClass implementingIndirectSet. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> IndirectList<E>Construct an emptyIndirectListwith the default initial capacity (10) and default capacity increment (0).static <E> IndirectList<E>createIndirectList(int initialCapacity) Construct an emptyIndirectListwith the specified initial capacity and default capacity increment (0).static <E> IndirectList<E>createIndirectList(Collection<? extends E> collection) Construct anIndirectListcontaining the elements of the specified collection, in the order they are returned by the collection's iterator.static <K,V> IndirectMap<K, V> Construct a new, emptyIndirectMapwith the default initial capacity (11) and the default load factor (0.75).static <K,V> IndirectMap<K, V> createIndirectMap(int initialCapacity) Construct a new, emptyIndirectMapwith the specified initial capacity and the default load factor (0.75).static <K,V> IndirectMap<K, V> createIndirectMap(Map<? extends K, ? extends V> map) Construct a newIndirectMapwith the same mappings as the given Map.static <E> IndirectSet<E>Construct an emptyIndirectSetwith the default initial capacity (10) and the default load factor (0.75).static <E> IndirectSet<E>createIndirectSet(int initialCapacity) Construct an emptyIndirectSetwith the specified initial capacity and the default load factor (0.75).static <E> IndirectSet<E>createIndirectSet(Collection<? extends E> collection) Constructs anIndirectSetcontaining the elements of the specified collection.
-
Field Details
-
IndirectList_Class
Class implementingIndirectList. -
IndirectSet_Class
Class implementingIndirectSet. -
IndirectMap_Class
Class implementingIndirectMap.
-
-
Constructor Details
-
IndirectCollectionsFactory
public IndirectCollectionsFactory()
-
-
Method Details
-
createIndirectList
Construct an emptyIndirectListwith the default initial capacity (10) and default capacity increment (0).- Type Parameters:
E- the class of the objects in the list- Returns:
- an empty
IndirectListwith the default initial capacity and default capacity increment
-
createIndirectList
Construct an emptyIndirectListwith 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
IndirectListwith the specified initial capacity and default capacity increment - Throws:
IllegalArgumentException- if the specified initial capacity is negative
-
createIndirectList
Construct anIndirectListcontaining 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 theIndirectListwith.- Returns:
- an
IndirectListcontaining the elements of the specified collection
-
createIndirectSet
Construct an emptyIndirectSetwith the default initial capacity (10) and the default load factor (0.75).- Returns:
- an empty
IndirectSetwith the default initial capacity and the default load factor
-
createIndirectSet
Construct an emptyIndirectSetwith the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity- the initial capacity of the set- Returns:
- an empty
IndirectSetwith the specified initial capacity and the default load factor - Throws:
IllegalArgumentException- if the specified initial capacity is negative
-
createIndirectSet
Constructs anIndirectSetcontaining the elements of the specified collection.- Parameters:
collection- a collection containing the elements to construct theIndirectSetwith- Returns:
- an
IndirectSetcontaining the elements of the specified collection - Throws:
NullPointerException- if the specified collection is null
-
createIndirectMap
Construct a new, emptyIndirectMapwith the default initial capacity (11) and the default load factor (0.75).- Returns:
- a new, empty
IndirectMapwith the default initial capacity and the default load factor
-
createIndirectMap
Construct a new, emptyIndirectMapwith the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity- the initial capacity of theIndirectMap- Returns:
- a new, empty
IndirectMapwith the specified initial capacity and the default load factor - Throws:
IllegalArgumentException- if the initial capacity is less than or equal to zero
-
createIndirectMap
Construct a newIndirectMapwith the same mappings as the given Map. TheIndirectMapis 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
IndirectMapwith the same mappings as the given Map - Throws:
NullPointerException- if the specified map is null
-