Class DefaultSpeciesNewStrategy
java.lang.Object
org.eclipse.collections.impl.utility.internal.DefaultSpeciesNewStrategy
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> Collection<T>
speciesNew
(Collection<?> collection) Creates a new instance of a collection based on the class type of collection, not on the type of objects the collections contains.<T> Collection<T>
speciesNew
(Collection<?> collection, int size) Creates a new instance of a collection based on the class type of collection and specified initial capacity, not on the type of objects the collections contains.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultSpeciesNewStrategy
public DefaultSpeciesNewStrategy()
-
-
Method Details
-
speciesNew
Creates a new instance of a collection based on the class type of collection, not on the type of objects the collections contains. e.g.CollectionFactory.<Integer>speciesNew(hashSetOfString)
returns a newHashSet<Integer>()
; e.g.CollectionFactory.<Date>speciesNew(linkedListOfWombles)
returns a newLinkedList<Date>()
; -
speciesNew
Creates a new instance of a collection based on the class type of collection and specified initial capacity, not on the type of objects the collections contains. e.g.CollectionFactory.<Integer>speciesNew(hashSetOfString, 20)
returns a newHashSet<Integer>(20)
; e.g.CollectionFactory.<Date>speciesNew(linkedListOfWombles, 42)
returns a newLinkedList<Date>(42)
;
-