Package org.eclipse.collections.api.set
Interface Pool<V>
- All Known Implementing Classes:
AbstractUnifiedSet
,UnifiedSet
,UnifiedSetWithHashingStrategy
public interface Pool<V>
-
Method Summary
-
Method Details
-
get
Locates an object in the pool which is equal tokey
.- Parameters:
key
- the value to look for- Returns:
- The object reference in the pool equal to key or null.
-
clear
void clear() -
put
Putskey
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 tokey
, the pool will remain unchanged and the pooled instance will be is returned.- Parameters:
key
- the value to add if not in the pool- Returns:
- the object reference in the pool equal to key (either key itself or the existing reference)
-
size
int size() -
removeFromPool
Locates an object in the pool which is equal tokey
and removes it.- Parameters:
key
- object to remove- Returns:
- The object reference in the pool equal to key or null.
-