public abstract class AbstractExpiryCollection<T> extends Object implements ExpiryCollection<T>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractExpiryCollection.Encp |
| Constructor and Description |
|---|
AbstractExpiryCollection(long cleanerThreadIntervalInMilliSecond) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire()
Before running sequence of operations on the collection (like iterating, adding element, etc.),
it is recommended to acquire the lock so that the cleaner thread does not
run in-between the operation.
|
boolean |
add(T t,
long expiryTime) |
void |
clear() |
boolean |
contains(T t) |
abstract Collection<AbstractExpiryCollection.Encp> |
getData() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
void |
release()
Whenever lock is acquired, make sure to release it (preferably in finally
block).
|
void |
shutdown()
Call to this method will send a interrupt signal to the cleaner thread and
make it quit.
|
int |
size() |
public AbstractExpiryCollection(long cleanerThreadIntervalInMilliSecond)
public abstract Collection<AbstractExpiryCollection.Encp> getData()
public boolean add(T t, long expiryTime)
add in interface ExpiryCollection<T>public void clear()
clear in interface ExpiryCollection<T>public boolean contains(T t)
contains in interface ExpiryCollection<T>public boolean isEmpty()
isEmpty in interface ExpiryCollection<T>public int size()
size in interface ExpiryCollection<T>public void acquire()
ExpiryCollectionacquire in interface ExpiryCollection<T>public void release()
ExpiryCollectionrelease in interface ExpiryCollection<T>public void shutdown()
ExpiryCollectionshutdown in interface ExpiryCollection<T>Copyright © 2014. All rights reserved.