|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary<K,V> java.util.Hashtable<K,java.lang.Integer> urv.olsr.data.ExpiringEntryTable<K,V>
public abstract class ExpiringEntryTable<K,V>
Table which stores some information that may eventually expire if no updates are received during a certain time span The access to the table is synchronized
Constructor Summary | |
---|---|
ExpiringEntryTable()
Creates a new table that will remove an entry which has not receive an update in expiringTime
milliseconds |
Method Summary | |
---|---|
void |
addEntryWithTimestamp(K key,
V value,
int timestamp)
Adds a new entry in the table Mark the entry as information up-to-date |
void |
decreaseTimeAndProcessEntries(long refreshTime)
Decreases the valid time for all entries and removes the ones which exceed the maximum time |
V |
getEntry(K key)
Return the entry corresponding with the given key |
java.lang.Object |
getLock()
|
java.util.Set<K> |
keySet()
|
abstract void |
onTableChange()
|
void |
overwriteEntryWithTimestamp(K key,
V value,
int timestamp)
Overwrite an existing entry in the table Mark the entry as information up-to-date |
void |
removeEntry(K key)
Removes an entry from the table |
java.lang.String |
toString()
|
void |
updateTimestampInEntry(K key,
int msec)
|
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, put, putAll, rehash, remove, size, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExpiringEntryTable()
expiringTime
milliseconds
expiringTime
- Method Detail |
---|
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,java.lang.Integer>
keySet
in class java.util.Hashtable<K,java.lang.Integer>
public java.lang.String toString()
toString
in class java.util.Hashtable<K,java.lang.Integer>
public void addEntryWithTimestamp(K key, V value, int timestamp)
key
- value
- timestamp
- the validity time of this entry in millisecondspublic void decreaseTimeAndProcessEntries(long refreshTime)
refreshTime
- public V getEntry(K key)
key
- public abstract void onTableChange()
public void overwriteEntryWithTimestamp(K key, V value, int timestamp)
key
- value
- timestamp
- the validity time of this entry in millisecondspublic void removeEntry(K key)
key
- public void updateTimestampInEntry(K key, int msec)
public java.lang.Object getLock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |