java.util.Map<T,K>
public class PrioritizingLimitedMap<T extends java.lang.Comparable<T>,K>
extends java.lang.Object
implements java.util.Map<T,K>
Modifier and Type | Field | Description |
---|---|---|
protected com.planet_ink.coffee_mud.core.collections.PrioritizingLimitedMap.LinkedEntry<T,K> |
head |
|
protected int |
itemLimit |
|
protected java.util.SortedMap<T,com.planet_ink.coffee_mud.core.collections.PrioritizingLimitedMap.LinkedEntry<T,K>> |
map |
|
protected long |
maxAgeLimitMillis |
|
protected int |
origItemLimit |
|
protected com.planet_ink.coffee_mud.core.collections.PrioritizingLimitedMap.LinkedEntry<T,K> |
tail |
|
protected int |
threshHoldToExpand |
|
protected long |
touchAgeLimitMillis |
|
protected java.util.concurrent.atomic.AtomicBoolean |
trimming |
Constructor | Description |
---|---|
PrioritizingLimitedMap(int itemLimit,
long touchAgeLimitMillis,
long maxAgeLimitMillis) |
Constructed a "limit" tree-based map.
|
PrioritizingLimitedMap(int itemLimit,
long touchAgeLimitMillis,
long maxAgeLimitMillis,
int threshHoldToExpand) |
Constructed a "limit" tree-based map.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
boolean |
containsKey(java.lang.Object arg0) |
|
boolean |
containsValue(java.lang.Object arg0) |
|
java.util.Set<java.util.Map.Entry<T,K>> |
entrySet() |
|
K |
get(java.lang.Object key) |
|
boolean |
isEmpty() |
|
java.util.Set<T> |
keySet() |
|
java.util.Enumeration<T> |
prioritizedKeys() |
|
K |
put(T arg0,
K arg1) |
|
void |
putAll(java.util.Map<? extends T,? extends K> arg0) |
|
K |
remove(java.lang.Object arg0) |
|
int |
size() |
|
java.util.Collection<K> |
values() |
protected int itemLimit
protected final int origItemLimit
protected final long touchAgeLimitMillis
protected final long maxAgeLimitMillis
protected final int threshHoldToExpand
protected final java.util.concurrent.atomic.AtomicBoolean trimming
protected volatile com.planet_ink.coffee_mud.core.collections.PrioritizingLimitedMap.LinkedEntry<T extends java.lang.Comparable<T>,K> head
protected volatile com.planet_ink.coffee_mud.core.collections.PrioritizingLimitedMap.LinkedEntry<T extends java.lang.Comparable<T>,K> tail
public PrioritizingLimitedMap(int itemLimit, long touchAgeLimitMillis, long maxAgeLimitMillis, int threshHoldToExpand)
itemLimit
- the number of items to try to limit this map totouchAgeLimitMillis
- the age of last-touching that makes an item too old to keepmaxAgeLimitMillis
- the longest amount of time any entry is allowed to live,
regardless of touchingthreshHoldToExpand
- the number of touches on any given item before the limit
expands to accommodate, or 0 to disablepublic PrioritizingLimitedMap(int itemLimit, long touchAgeLimitMillis, long maxAgeLimitMillis)
itemLimit
- the number of items to try to limit this map totouchAgeLimitMillis
- the age of last-touching that makes an item too old to keepmaxAgeLimitMillis
- the longest amount of time any entry is allowed to live,
regardless of touchingpublic K get(java.lang.Object key)
public void clear()
public boolean containsKey(java.lang.Object arg0)
public java.util.Enumeration<T> prioritizedKeys()
public boolean containsValue(java.lang.Object arg0)
public boolean isEmpty()
public java.util.Set<T> keySet()
public K remove(java.lang.Object arg0)
public int size()