Interface IndirectCollectionsFactory.IndirectCollectionsProvider
-
- Enclosing class:
- IndirectCollectionsFactory
public static interface IndirectCollectionsFactory.IndirectCollectionsProvider
Define API providers ofIndirectCollection
implementations 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 emptyIndirectList
with the specified initial capacity and capacity increment.<E> IndirectList<E>
createIndirectList(java.util.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(java.util.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(java.util.Collection<? extends E> collection)
Constructs anIndirectSet
containing the elements of the specified collection.java.lang.Class
getListClass()
Class implementingIndirectList
.java.lang.Class
getMapClass()
Class implementingIndirectMap
.java.lang.Class
getSetClass()
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 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:
java.lang.IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectList
<E> IndirectList<E> createIndirectList(java.util.Collection<? extends E> collection)
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:
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 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:
java.lang.IllegalArgumentException
- if the specified initial capacity is negative
-
createIndirectSet
<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
-
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, 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:
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 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
-
-