public interface Pool<V>
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
get(V key)
Locates an object in the pool which is equal to
key . |
V |
put(V key)
Puts
key into the pool. |
V |
removeFromPool(V key)
Locates an object in the pool which is equal to
key and removes it. |
int |
size() |
V get(V key)
key
.key
- the value to look forvoid clear()
V put(V key)
key
into the pool. If there is no existing object that is equal
to key, key will be added to the pool and the return value will be the same instance.
If there is an existing object in the pool that is equal to key
, the pool will remain unchanged
and the pooled instance will be is returned.key
- the value to add if not in the poolint size()
Copyright © 2004–2016. All rights reserved.