T
- Type of reusable objectpublic class MultiSizedReusable<T> extends Object implements Int2ObjFunction<T>
Constructor and Description |
---|
MultiSizedReusable(Int2ObjFunction<T> createSized,
Consumer<T> init) |
Modifier and Type | Method and Description |
---|---|
T |
apply(int size)
Returns the result of applying this function to given
input . |
static <K,V> MultiSizedReusable<Basic2ObjectMap<K,V>> |
createForBasic2ObjectMap(PrimitiveIdTypeOps<K> idTypeOps) |
static <I> MultiSizedReusable<BasicSet<I>> |
createForBasicSet(PrimitiveIdTypeOps<I> idTypeOps) |
public MultiSizedReusable(Int2ObjFunction<T> createSized, Consumer<T> init)
public T apply(int size)
Int2ObjFunction
input
.
The returned object may or may not be a new instance,
depending on the implementation.apply
in interface Int2ObjFunction<T>
size
- inputpublic static <I> MultiSizedReusable<BasicSet<I>> createForBasicSet(PrimitiveIdTypeOps<I> idTypeOps)
public static <K,V> MultiSizedReusable<Basic2ObjectMap<K,V>> createForBasic2ObjectMap(PrimitiveIdTypeOps<K> idTypeOps)
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.