Interface IndirectCollectionsFactory.IndirectCollectionsProvider
- Enclosing class:
- IndirectCollectionsFactory
public static interface IndirectCollectionsFactory.IndirectCollectionsProvider
Define API providers of
IndirectCollection
implementations must conform to.-
Method Summary
Modifier and TypeMethodDescription<E> IndirectList<E>
createIndirectList
(int initialCapacity, int capacityIncrement) Construct an emptyIndirectList
with the specified initial capacity and capacity increment.<E> IndirectList<E>
createIndirectList
(Collection<? extends E> collection) Constructs anIndirectList
containing the elements of the specified collection, in the order they are returned by the collection's iterator.<K,
V> IndirectMap<K, V> createIndirectMap
(int initialCapacity, float loadFactor) Construct a new, emptyIndirectMap
with the specified initial capacity and the specified load factor.<K,
V> IndirectMap<K, V> createIndirectMap
(Map<? extends K, ? extends V> map) Construct a newIndirectMap
with the same mappings as the given Map.<E> IndirectSet<E>
createIndirectSet
(int initialCapacity, float loadFactor) Construct an emptyIndirectSet
with the specified initial capacity and the specified load factor.<E> IndirectSet<E>
createIndirectSet
(Collection<? extends E> collection) Constructs anIndirectSet
containing the elements of the specified collection.Class implementingIndirectList
.Class implementingIndirectMap
.Class implementingIndirectSet
.
-
Method Details
-
getListClass
Class getListClass()Class implementingIndirectList
.- Returns:
- class implementing
IndirectList
-
createIndirectList
Construct an emptyIndirectList
with the specified initial capacity and capacity increment.- Type Parameters:
E
- the class of the objects in the list- Parameters:
initialCapacity
- the initial capacity of the listcapacityIncrement
- the amount by which the capacity is increased when the list overflows- Returns:
- an empty
IndirectList
with the specified initial capacity and capacity increment - Throws:
IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectList
Constructs 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 - Throws:
NullPointerException
- if the specified collection is null
-
getSetClass
Class getSetClass()Class implementingIndirectSet
.- Returns:
- class implementing
IndirectSet
-
createIndirectSet
Construct an emptyIndirectSet
with the specified initial capacity and the specified load factor.- Parameters:
initialCapacity
- the initial capacity of the setloadFactor
- the load factor of the set- Returns:
- an empty
IndirectSet
with the specified initial capacity and the specified load factor - Throws:
IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectSet
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:
NullPointerException
- if the specified collection is null
-
getMapClass
Class getMapClass()Class implementingIndirectMap
.- Returns:
- class implementing
IndirectMap
-
createIndirectMap
Construct a new, emptyIndirectMap
with the specified initial capacity and the specified load factor.- Parameters:
initialCapacity
- the initial capacity of theIndirectMap
loadFactor
- a number between 0.0 and 1.0- Returns:
- a new, empty
IndirectMap
with the specified initial capacity and the specified load factor - Throws:
IllegalArgumentException
- if the initial capacity is less than or equal to zero, or if the load factor is less than or equal to zero
-
createIndirectMap
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:
NullPointerException
- if the specified map is null
-