Top Fields Constructors Methods
org.eclipse.collections.impl.utility.internal

public Class DefaultSpeciesNewStrategy

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Proxy, java.util.Collection, .PriorityQueue, .Set, .SortedSet, java.util.concurrent.PriorityBlockingQueue, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.factory.Lists, .Sets

Field Summary

Modifier and TypeField and Description
public static final DefaultSpeciesNewStrategy
private static final Class<?>[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <T> Collection<T>
public <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.

public <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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final DefaultSpeciesNewStrategy INSTANCE
SIZE_CONSTRUCTOR_TYPESback to summary
private static final Class<?>[] SIZE_CONSTRUCTOR_TYPES

Constructor Detail

DefaultSpeciesNewStrategyback to summary
public DefaultSpeciesNewStrategy()

Method Detail

createNewInstanceForCollectionTypeback to summary
private static <T> Collection<T> createNewInstanceForCollectionType(Collection<?> collection)
speciesNewback to summary
public <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. e.g. CollectionFactory.<Integer>speciesNew(hashSetOfString) returns a new HashSet<Integer>(); e.g. CollectionFactory.<Date>speciesNew(linkedListOfWombles) returns a new LinkedList<Date>();

speciesNewback to summary
public <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. e.g. CollectionFactory.<Integer>speciesNew(hashSetOfString, 20) returns a new HashSet<Integer>(20); e.g. CollectionFactory.<Date>speciesNew(linkedListOfWombles, 42) returns a new LinkedList<Date>(42);