Interface IndirectCollectionsFactory.IndirectCollectionsProvider
-
- Enclosing class:
- IndirectCollectionsFactory
public static interface IndirectCollectionsFactory.IndirectCollectionsProviderDefine API providers ofIndirectCollectionimplementations must conform to.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <E> IndirectList<E>createIndirectList(int initialCapacity, int capacityIncrement)Construct an emptyIndirectListwith the specified initial capacity and capacity increment.<E> IndirectList<E>createIndirectList(java.util.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(java.util.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(java.util.Collection<? extends E> collection)Constructs anIndirectSetcontaining the elements of the specified collection.java.lang.ClassgetListClass()Class implementingIndirectList.java.lang.ClassgetMapClass()Class implementingIndirectMap.java.lang.ClassgetSetClass()Class implementingIndirectSet.
-
-
-
Method Detail
-
getListClass
java.lang.Class getListClass()
Class implementingIndirectList.- Returns:
- class implementing
IndirectList
-
createIndirectList
<E> IndirectList<E> createIndirectList(int initialCapacity, int capacityIncrement)
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:
java.lang.IllegalArgumentException- if the specified initial capacity is negative
-
createIndirectList
<E> IndirectList<E> createIndirectList(java.util.Collection<? extends E> collection)
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:
java.lang.NullPointerException- if the specified collection is null
-
getSetClass
java.lang.Class getSetClass()
Class implementingIndirectSet.- Returns:
- class implementing
IndirectSet
-
createIndirectSet
<E> IndirectSet<E> createIndirectSet(int initialCapacity, float loadFactor)
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:
java.lang.IllegalArgumentException- if the specified initial capacity is negative
-
createIndirectSet
<E> IndirectSet<E> createIndirectSet(java.util.Collection<? extends E> collection)
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:
java.lang.NullPointerException- if the specified collection is null
-
getMapClass
java.lang.Class getMapClass()
Class implementingIndirectMap.- Returns:
- class implementing
IndirectMap
-
createIndirectMap
<K,V> IndirectMap<K,V> createIndirectMap(int initialCapacity, float loadFactor)
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:
java.lang.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
<K,V> IndirectMap<K,V> createIndirectMap(java.util.Map<? extends K,? extends V> map)
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:
java.lang.NullPointerException- if the specified map is null
-
-