|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fedorchuck.developers_notification.helpers.Lifetime<V>
public class Lifetime<V>
Stack with the lifetime of objects. This stack automatic remove objects which are obsolete.
Author: Volodymyr Fedorchuk
| Constructor Summary | |
|---|---|
Lifetime(long timeToLive,
long updateTimerInterval)
Constructor of stack. |
|
| Method Summary | |
|---|---|
boolean |
contains(V object)
Returns true if this stack contains the specified element. |
V |
get(int index)
Returns the element at the specified position in this stack. |
V |
getOldest()
Returns the element at the specified position in this stack. |
void |
put(V value)
Appends the specified element to the end of this stack. |
int |
size()
Returns the number of elements in this stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Lifetime(long timeToLive,
long updateTimerInterval)
timeToLive - time of living for added objectsupdateTimerInterval - time of interval updating for find and remove obsolete objects| Method Detail |
|---|
public void put(V value)
value - element to be appended to this stackpublic V get(int index)
index - index of the element to return
java.lang.IndexOutOfBoundsException - if the index is out of range
index less than 0 || index more or equal size()public V getOldest()
null if this stack is emptypublic int size()
public boolean contains(V object)
object - element whose presence in this stack is to be tested
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||