|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--SSF.OS.NetFlow.ShrinkableHashMap
User defined HashMap. It can shrink as well as grow dynamically according to the usage of memory
| Constructor Summary | |
ShrinkableHashMap()
this default constructor should NOT be used |
|
ShrinkableHashMap(int initialCapacity)
Constructor: the LoadFactor is always set to be 1.0 specify the intial capacity |
|
ShrinkableHashMap(int initialCapacity,
float upperFactor)
Constructor: specify the upperFactor and the initCapacity |
|
ShrinkableHashMap(int initialCapacity,
float upperFactor,
float lowerFactor)
Constructor: to specify the lower bound factor, it is necessary to specify the upperLoad factor too so that compiler won't get confused |
|
| Method Summary | |
java.lang.Object |
get(java.lang.Object key)
Return the object of the given key notice that potentially an object list is returned |
protected void |
growRehash()
enlarge the table size by 2 (plus 1) |
void |
put(java.lang.Object key,
java.lang.Object Item)
Put the object with given key in the map. |
void |
remove(java.lang.Object key)
Remove the object corrsponding to the given key if the memory utilization is low enough, shrink |
protected void |
shrinkRehash()
shrink the table size by half |
java.util.Collection |
values()
Return a collection view of all the objects stored in the map |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ShrinkableHashMap()
public ShrinkableHashMap(int initialCapacity)
public ShrinkableHashMap(int initialCapacity,
float upperFactor)
public ShrinkableHashMap(int initialCapacity,
float upperFactor,
float lowerFactor)
| Method Detail |
protected void shrinkRehash()
protected void growRehash()
public void put(java.lang.Object key,
java.lang.Object Item)
public java.lang.Object get(java.lang.Object key)
public java.util.Collection values()
public void remove(java.lang.Object key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||