public class TimeoutList<T>
extends java.lang.Object
Constructor and Description |
---|
TimeoutList(long timeout) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T item)
Checks whether an item is considered alive
|
java.util.Set<T> |
getItems()
Returns a list (copy) of alive items.
|
void |
remove(T item)
Removes an item from the alive list.
|
void |
report(T item)
Reports an item as alive.
|
public TimeoutList(long timeout)
timeout
- the timeout after which a device is assumed to be deadpublic void report(T item)
item
- the item to be reported as alivepublic void remove(T item)
item
- the item that is no longer alive.public boolean contains(T item)
item
- the item to check forpublic java.util.Set<T> getItems()