|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.util.TimedExpirySupport
public class TimedExpirySupport
Handles expiration after some interval of time has passed. Expiration time is computed as a random value between a specified minimum and a specified maximum delay interval.
Field Summary | |
---|---|
protected boolean |
expired
|
protected long |
expiryTime
|
protected long |
maxExpiryTime
|
protected long |
minExpiryTime
|
protected static Random |
rand
|
Constructor Summary | |
---|---|
TimedExpirySupport()
Constructs an instance with minimum expiry interval of 1 second and a max of 2 seconds. |
|
TimedExpirySupport(long minExpiryTime,
long maxExpiryTime)
Constructs an instance with specified minimum and maximum expiry intervals. |
Method Summary | |
---|---|
long |
getExpiryTime()
Indicates the current expiration time, which is a random value between the specified minimum and maximum. |
long |
getMaxExpiryTime()
Indicates this timer's maximum expiry interval. |
long |
getMinExpiryTime()
Indicates this timer's minimum expiry interval. |
boolean |
isExpired(DrawContext dc)
Indicates whether this timer has expired. |
boolean |
isExpired(long now)
Indicates whether this timer has expired. |
void |
restart(DrawContext dc)
Marks this timer as not expired and restarts the timer. |
void |
setExpired(boolean expired)
Set the expiration state of this timer. |
void |
setExpiryTime(long minExpiryTime,
long maxExpiryTime)
Specifies the minimum and maximum expiration intervals. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean expired
protected long expiryTime
protected long maxExpiryTime
protected long minExpiryTime
protected static Random rand
Constructor Detail |
---|
public TimedExpirySupport()
public TimedExpirySupport(long minExpiryTime, long maxExpiryTime)
minExpiryTime
- the minimum interval allowed to pass before expiration, in milliseconds.maxExpiryTime
- the maximum interval allowed to pass before expiration, in milliseconds.Method Detail |
---|
public long getExpiryTime()
public long getMaxExpiryTime()
public long getMinExpiryTime()
public boolean isExpired(DrawContext dc)
dc
- the current draw context.
IllegalArgumentException
- if the draw context is null.public boolean isExpired(long now)
now
- the time to relate this timer's expiration time to. The timer is considered expired if this timer's
expiry time is less than this value.
public void restart(DrawContext dc)
dc
- the current draw context.
IllegalArgumentException
- if the draw context is null.public void setExpired(boolean expired)
expired
- true to indicate expired, false to indicate not expired.public void setExpiryTime(long minExpiryTime, long maxExpiryTime)
minExpiryTime
- the minimum interval allowed to pass before expiration, in milliseconds.maxExpiryTime
- the maximum interval allowed to pass before expiration, in milliseconds.
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |