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 emptyIndirectListwith the specified initial capacity and capacity increment.<E> IndirectList<E>createIndirectList(Collection<? extends E> collection) Constructs anIndirectListcontaining 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, emptyIndirectMapwith the specified initial capacity and the specified load factor.<K,V> IndirectMap<K, V> createIndirectMap(Map<? extends K, ? extends V> map) Construct a newIndirectMapwith the same mappings as the given Map.<E> IndirectSet<E>createIndirectSet(int initialCapacity, float loadFactor) Construct an emptyIndirectSetwith the specified initial capacity and the specified load factor.<E> IndirectSet<E>createIndirectSet(Collection<? extends E> collection) Constructs anIndirectSetcontaining 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 emptyIndirectListwith 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
IndirectListwith the specified initial capacity and capacity increment - Throws:
IllegalArgumentException- if the specified initial capacity is negative
-
createIndirectList
Constructs 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 - Throws:
NullPointerException- if the specified collection is null
-
getSetClass
Class getSetClass()Class implementingIndirectSet.- Returns:
- class implementing
IndirectSet
-
createIndirectSet
Construct an emptyIndirectSetwith 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
IndirectSetwith the specified initial capacity and the specified 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
-
getMapClass
Class getMapClass()Class implementingIndirectMap.- Returns:
- class implementing
IndirectMap
-
createIndirectMap
Construct a new, emptyIndirectMapwith the specified initial capacity and the specified load factor.- Parameters:
initialCapacity- the initial capacity of theIndirectMaploadFactor- a number between 0.0 and 1.0- Returns:
- a new, empty
IndirectMapwith 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 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
-