Package org.eclipse.collections.api.set
Interface Pool<V>
-
- All Known Implementing Classes:
AbstractUnifiedSet
,UnifiedSet
,UnifiedSetWithHashingStrategy
public interface Pool<V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
V
get(V key)
Locates an object in the pool which is equal tokey
.V
put(V key)
Putskey
into the pool.V
removeFromPool(V key)
Locates an object in the pool which is equal tokey
and removes it.int
size()
-
-
-
Method Detail
-
get
V get(V key)
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
V put(V key)
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()
-
-