| Constructor and Description |
|---|
Timeout(String name,
long value)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
check()
Throws a TimeoutExpiredException exception if timeout has been expired.
|
Timeout |
clone() |
boolean |
expired()
Checks if timeout has been expired after start() invocation.
|
String |
getName()
Returns timeout name.
|
long |
getValue()
Returns timeout value.
|
void |
setValue(long value) |
void |
sleep()
Sleeps for timeout value.
|
void |
start()
Starts timeout measuring.
|
String |
toString() |
public Timeout(String name, long value)
name - Timeout name.value - Timeout value in milliseconds.public String getName()
public long getValue()
public void setValue(long value)
public void sleep()
public void start()
public boolean expired()
public void check()
TimeoutExpiredException - if timeout has been expired after start() invocation.Copyright © 2018. All rights reserved.