public class RotatingMap<K,V> extends Object
get, put, remove, containsKey, and size take O(numBuckets) time to run.
The advantage of this design is that the expiration thread only locks the object for O(1) time, meaning the object is essentially always available for gets/puts.
Note: This class is not thread-safe since it does not protect against changes to buckets while it is being read
Modifier and Type | Class and Description |
---|---|
static interface |
RotatingMap.ExpiredCallback<K,V> |
Constructor and Description |
---|
RotatingMap(int numBuckets) |
RotatingMap(int numBuckets,
RotatingMap.ExpiredCallback<K,V> callback) |
RotatingMap(RotatingMap.ExpiredCallback<K,V> callback) |
public RotatingMap(int numBuckets, RotatingMap.ExpiredCallback<K,V> callback)
public RotatingMap(RotatingMap.ExpiredCallback<K,V> callback)
public RotatingMap(int numBuckets)
Copyright © 2022. All rights reserved.