Package com.attivio.sysstate
Class InstanceStateCounter
- java.lang.Object
-
- com.attivio.sysstate.InstanceStateCounter
-
- All Implemented Interfaces:
java.io.Serializable
public class InstanceStateCounter extends java.lang.Object implements java.io.Serializableholds a count of the time a particular instance is in any one state. not thread-safe.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstanceStateCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstanceStatechangeState(InstanceState newState)Changes current state to the new state, accumulating any time that has passed since the last state change.voidclear()Clears all counts to 0.InstanceStategetCurrentState()longgetTime(InstanceState state)
-
-
-
Method Detail
-
changeState
public InstanceState changeState(InstanceState newState)
Changes current state to the new state, accumulating any time that has passed since the last state change.- Parameters:
newState-- Returns:
- the previous state
-
getTime
public long getTime(InstanceState state)
-
getCurrentState
public InstanceState getCurrentState()
-
clear
public void clear()
Clears all counts to 0.
-
-