Package gov.nasa.worldwind.util
Interface Pool<T>
-
- Type Parameters:
T
- the pooled type
- All Known Implementing Classes:
BasicPool
,SynchronizedPool
public interface Pool<T>
Pool provides an interface for managing a pool of object instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
acquire()
Acquires an instance from the pool.void
release(T instance)
Releases an instance to the pool.
-
-
-
Method Detail
-
acquire
T acquire()
Acquires an instance from the pool. This returns null if the pool is empty.- Returns:
- an instance from the pool, or null if the pool is empty
-
release
void release(T instance)
Releases an instance to the pool. This has no effect if the instance is null.- Parameters:
instance
- the instance to release
-
-