[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

CanPreventSleep

mixes in with Object
mixes in with HasReinitialize

CanPreventSleep



Operations

Get list of all operations

AccessDoze
AccessSleep
CanSleep
Copying
Finalize
Init
Reinitialize
ReleaseDoze
ReleasePowerAndSleep
ReleaseSleep


Attributes

Get list of all attributes

DozeCount
SleepCount


Fields

Field Type
CanPreventSleep: dozeCount: Signed
sleepCount: Signed


Instance template

Class CanPreventSleep cannot be instantiated.


Class definition

Define Class CanPreventSleep;
    // a class inheriting from CanPreventSleep must somehow inherit from HasReinitialize
    mixes in with Object, HasReinitialize;

    // mixed in by objects that want to be able to prevent the device
    // from going into low-power mode (dozing), and/or the device from going
    // to sleep (turn off).

    field dozeCount: Signed, getter;
        // number of doze accesses of this instance remaining before system can doze
    field sleepCount: Signed, getter;
        // number of sleep accesses of this instance remaining before system can doze

    attribute DozeCount: Signed;
        // number of doze accesses of this instance remaining before system can doze
    attribute SleepCount: Signed;
        // number of sleep accesses of this instance remaining before system can doze

    operation AccessDoze();
        // increase the doze access count for this instance
    operation ReleaseDoze();
        // decrease the doze access count for this instance

    operation AccessSleep();
        // increase the sleep access count for this instance
    operation ReleaseSleep();
        // decrease the sleep access count for this instance

    operation CanSleep(userInitiated: Boolean): Boolean;
        // called by the power manager to see if its O.K. to turn off the main power
        // to the device
        // sometimes overriden
    operation ReleasePowerAndSleep();
        // ReleaseDoze and ReleaseSleep on the object, then TryToSleep

    overrides Init, Reinitialize, Copying;
        // overriden to register the object with the power manager
    overrides Finalize;
        // overriden to unregister the object
end class;