Implementation of Subject interface.

Hierarchy (view full)

Implements

Constructors

Methods

  • Adds the given Observer to this Subject's list of Observers, so that the Observer will be notified of changes in this Subject. An Observer may call Subject.addObserver during its observe method.

    Parameters

    Returns void

  • Adds the Parameter to the list of this Subject's available Parameters.

    Parameters

    Returns void

    Throws

    if a Parameter with the same name already exists.

  • Notifies all Observers that the Parameter with the given name has changed by calling observe on each Observer.

    Parameters

    • name: string

      the language-independent or English name of the Parameter that has changed

    Returns void

    Throws

    if there is no Parameter with the given name

  • Execute the set of delayed commands to add/remove observers. This addresses the issue that an Observer can call addObserver or removeObserver during it's observe() method.

    Returns void

  • Return the language-independent name of this Subject for scripting purposes.

    Returns string

    name the language-independent name of this Subject

  • Returns the Parameter with the given name, or null if not found

    Parameters

    • name: string

      name of parameter to search for

    Returns undefined | Parameter

    the Parameter with the given name, or undefined if not found

  • Removes the Observer from this Subject's list of Observers. An Observer may call removeObserver during its observe method.

    Parameters

    • observer: Observer

      the Observer to detach from list of Observers

    Returns void

  • Removes the Parameter from the list of this Subject's available Parameters.

    Parameters

    Returns void

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.

    Parameters

    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc