Package | com.yworks.yfiles.util |
Class | public class Timer |
Inheritance | Timer YObject Object |
Property | Defined By | ||
---|---|---|---|
active : Boolean [read-only]
Returns whether or not this timer is active right now. | Timer | ||
elapsedTime : LongImpl [read-only]
Returns the period of time the timer has been in an activated state since the last reset occurred. | Timer | ||
stopped : Boolean [read-only]
Returns whether or not this timer is stopped (not active) right now. | Timer |
Method | Defined By | ||
---|---|---|---|
Timer(init:Boolean = true)
Creates a new instance of a timer. | Timer | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | Timer | ||
hashCode():int | YObject | ||
[static]
Creates a new instance of a timer. | Timer | ||
[static]
Creates a new instance of a timer, initially active or not. | Timer | ||
reset():void
Resets the elapsed time to 0. | Timer | ||
start():void
Starts or restarts this timer, if not already running. | Timer | ||
stop():void
Stops this timer, if not already stopped. | Timer | ||
toggle():void
Toggles the activation state if this timer. | Timer | ||
toString():String
Returns the elapsed time as String in a minutes, seconds, milliseconds format. | Timer |
Method | Defined By | ||
---|---|---|---|
initTimer1():void
Initializes this object. | Timer | ||
initTimer2(activate:Boolean):void
Initializes this object. | Timer |
active | property |
active:Boolean
[read-only] Returns whether or not this timer is active right now.
public function get active():Boolean
elapsedTime | property |
elapsedTime:LongImpl
[read-only] Returns the period of time the timer has been in an activated state since the last reset occurred.
public function get elapsedTime():LongImpl
stopped | property |
stopped:Boolean
[read-only] Returns whether or not this timer is stopped (not active) right now.
public function get stopped():Boolean
Timer | () | Constructor |
public function Timer(init:Boolean = true)
Creates a new instance of a timer. The timer is initially active.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initTimer1 | () | method |
protected final function initTimer1():void
Initializes this object. See the documentation of the corresponding factory method newTimer1()
for details.
See also
initTimer2 | () | method |
protected final function initTimer2(activate:Boolean):void
Initializes this object. See the documentation of the corresponding factory method newTimer2()
for details.
Parameters
activate:Boolean |
See also
newTimer1 | () | method |
public static function newTimer1():Timer
Creates a new instance of a timer. The timer is initially active.
ReturnsTimer |
newTimer2 | () | method |
public static function newTimer2(activate:Boolean):Timer
Creates a new instance of a timer, initially active or not.
Parameters
activate:Boolean — whether or not the timer should be initially active.
|
Timer |
reset | () | method |
public function reset():void
Resets the elapsed time to 0. This method does not change the state (running or not) of this timer.
start | () | method |
public function start():void
Starts or restarts this timer, if not already running. The time elapsed will not be reset by this method.
stop | () | method |
public function stop():void
Stops this timer, if not already stopped.
toggle | () | method |
public function toggle():void
Toggles the activation state if this timer.
toString | () | method |
public function toString():String
Returns the elapsed time as String in a minutes, seconds, milliseconds format.
ReturnsString |