|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections4.map.PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy<K,V>
K - the type of the keys in the mapV - the type of the values in the mappublic static class PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy<K,V>
A ExpirationPolicy
that returns a expiration time that is a
constant about of time in the future from the current time.
| Constructor Summary | |
|---|---|
PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy()
Default constructor. |
|
PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy(long timeToLiveMillis)
Construct a policy with the given time-to-live constant measured in milliseconds. |
|
PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy(long timeToLive,
TimeUnit timeUnit)
Construct a policy with the given time-to-live constant measured in the given time unit of measure. |
|
| Method Summary | |
|---|---|
long |
expirationTime(K key,
V value)
Determine the expiration time for the given key-value entry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy()
public PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy(long timeToLiveMillis)
timeToLiveMillis - the constant amount of time (in milliseconds)
an entry is available before it expires. A negative value
results in entries that NEVER expire. A zero value results in
entries that ALWAYS expire.
public PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy(long timeToLive,
TimeUnit timeUnit)
timeToLive - the constant amount of time an entry is available
before it expires. A negative value results in entries that
NEVER expire. A zero value results in entries that ALWAYS
expire.timeUnit - the unit of time for the timeToLive
parameter, must not be null.
IllegalArgumentException - if the time unit is null.| Method Detail |
|---|
public long expirationTime(K key,
V value)
expirationTime in interface PassiveExpiringMap.ExpirationPolicy<K,V>key - the key for the entry (ignored).value - the value for the entry (ignored).
timeToLiveMillis ≥ 0, an expiration time of
timeToLiveMillis +
System.currentTimeMillis() is returned. Otherwise, -1
is returned indicating the entry never expires.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||