Package com.esotericsoftware.kryo.pool
Class KryoPoolQueueImpl
- java.lang.Object
-
- com.esotericsoftware.kryo.pool.KryoPoolQueueImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.esotericsoftware.kryo.pool.KryoPool
KryoPool.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private KryoFactoryfactoryprivate java.util.Queue<Kryo>queue
-
Constructor Summary
Constructors Constructor Description KryoPoolQueueImpl(KryoFactory factory, java.util.Queue<Kryo> queue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Kryoborrow()Takes aKryoinstance from the pool or creates a new one (using the factory) if the pool is empty.voidclear()voidrelease(Kryo kryo)Returns the givenKryoinstance to the pool.<T> Trun(KryoCallback<T> callback)Runs the providedKryoCallbackwith aKryoinstance from the pool (borrow/release aroundKryoCallback.execute(Kryo)).intsize()
-
-
-
Field Detail
-
queue
private final java.util.Queue<Kryo> queue
-
factory
private final KryoFactory factory
-
-
Constructor Detail
-
KryoPoolQueueImpl
KryoPoolQueueImpl(KryoFactory factory, java.util.Queue<Kryo> queue)
-
-
Method Detail
-
size
public int size()
-
borrow
public Kryo borrow()
Description copied from interface:KryoPoolTakes aKryoinstance from the pool or creates a new one (using the factory) if the pool is empty.
-
release
public void release(Kryo kryo)
Description copied from interface:KryoPoolReturns the givenKryoinstance to the pool.
-
run
public <T> T run(KryoCallback<T> callback)
Description copied from interface:KryoPoolRuns the providedKryoCallbackwith aKryoinstance from the pool (borrow/release aroundKryoCallback.execute(Kryo)).
-
clear
public void clear()
-
-