Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: threadState

[22:6] static extends: object

Defines the state of the thread. One of these should be returned from getThreadState.

Members

  • st_new
  • st_runnable
  • st_blocked
  • st_waiting
  • st_timed_waiting
  • st_terminated

class: timer

[164:14] (extern: com.lehman.aussom.stdlib.AussomTimer) extends: object

The timer class implements timer functionality.

Methods

  • timer (int TimeMills, callback OnTimeOut)

    The timer constructor takes a few arguments and creates a new timer object.

    • @p TimeMills is the number of milliseconds for the timer.
    • @p OnTimeOut is a callback with the function to call when the timer ends.
    • @r This object.
  • newTimer (int TimeMills, callback OnTimeOut)

  • start ()

    Starts the timer to run only once.

    • @r This object.
  • startInterval ()

    Starts the timer running constantly.

    • @r This object.
  • stop ()

    Stops the timer.

    • @r This object.
  • restart ()

    Restarts the timer.

    • @r This object.
  • setDuration (int TimeMills)

    Sets the timer duration in milliseconds.

    • @p TimeMills is an int with the duration in milliseconds.
    • @r This object.
  • getDuration ()

    Gets the timer duration.

    • @r An int with the duration in milliseconds.

class: thread

[34:14] (extern: com.lehman.aussom.stdlib.AussomThread) extends: object

The thread class implements threading functionality.

Methods

  • setOnRun (callback Callback)

    Sets the on run callback function.

    • @p Callback is the function to be called on run.
    • @r This object.
  • startThread ()

    Starts the thread.

    • @r This object.
  • sleep (int MillsToWait = 0)

    Sleeps the provided number of milliseconds.

    • @p MillsToWait is an int with the number of milliseconds to wait.
    • @r This object.
  • interrupt ()

    Interrupts the thread.

    • @r This object.
  • setPriority (int Priority = 5)

    Sets the priority of the thread.

    • @p Priority is an int with the priority to set.
    • @r This object.
  • setName (string Name)

    Sets the thread name.

    • @p Name is a string to set for the thread name.
    • @r This object.
  • setDaemon (bool SetDaemon = true)

    Sets the thread as a daemon or not with the provided flag. This function with throw an exception if the thread is already alive.

    • @p SetDaemon is a bool with the flag.
    • @r This object.
  • start ()

    Starts the thread.

    • @r This object.
  • run ()

    Implemented just as a place holder. This function needs to be overridden by your implementation.

  • isInterrupted ()

    Gets the is interrupted flag.

    • @r A bool with is interrupted.
  • isAlive ()

    Gets the is alive flag.

    • @r A bool with the is alive flag.
  • getPriority ()

    Gets the thread priority.

    • @r An int with the priority.
  • join (int MillsToWait = 0)

    Joins the thread with the number of milliseconds to wait for the thread to die. 0 means wait forever.

    • @p MillsToWait is an int with the millseconds to wait.
    • @r This object.
  • isDaemon ()

    Gets the is daemon flag.

    • @r A bool with the is daemon flag.
  • toString ()

    Returns the Java representation of the thread. (See Thread.toString())

    • @r A string with the thread info.
  • getId ()

    Gets the thread ID.

    • @r An int with the thread ID.
  • getThreadState ()

    Gets the thread state.

    • @r A string with the thread state. See the threadState enum for available values.
  • getOnRun ()

    Gets the on run function.

    • @p A callback with the on run function.