public abstract class CameraStateHolder extends Object
Constructor and Description |
---|
CameraStateHolder(int state)
Construct a new instance of @{link CameraStateHolder} with an initial state.
|
Modifier and Type | Method and Description |
---|---|
int |
getState()
Obtain the current state.
|
void |
invalidate()
Change the state to be invalid.
|
boolean |
isInvalid()
Whether the state is invalid.
|
void |
setState(int state)
Change to a new state.
|
boolean |
waitForStates(int states)
Block the current thread until the state becomes one of the
specified.
|
boolean |
waitToAvoidStates(int states)
Block the current thread until the state becomes NOT one of the
specified.
|
public CameraStateHolder(int state)
state
- The initial state.public void setState(int state)
state
- The new state.public int getState()
public void invalidate()
public boolean isInvalid()
public boolean waitForStates(int states)
states
- Expected states.false
if the wait is interrupted or timeout limit is
reached.public boolean waitToAvoidStates(int states)
states
- States to avoid.false
if the wait is interrupted or timeout limit is
reached.