SimList | myPhysicsLab Docs

Properties

Private elements_

Static Readonly OBJECT_ADDED

OBJECT_ADDED: "OBJECT_ADDED" = 'OBJECT_ADDED'

Static Readonly OBJECT_MODIFIED

OBJECT_MODIFIED: "OBJECT_MODIFIED" = 'OBJECT_MODIFIED'

Static Readonly OBJECT_REMOVED

OBJECT_REMOVED: "OBJECT_REMOVED" = 'OBJECT_REMOVED'

Methods

add

  • add(...objs): void
  • Returns void

addAll

  • addAll(objList): void
  • Returns void

addObserver

  • addObserver(observer): void
  • Returns void

addParameter

  • addParameter(parameter): void
  • Returns void

broadcast

  • broadcast(evt): void
  • Returns void

broadcastParameter

  • broadcastParameter(name): void
  • Parameters

    • name: string

    Returns void

clear

  • clear(): void
  • Returns void

contains

  • contains(simObj): boolean
  • Returns boolean

    true if the SimObject is in this SimList.

get

  • get(arg): SimObject
  • Parameters

    • arg: string | number

    Returns SimObject

    the SimObject at the specified position in this SimList, or with the given name

getArc

  • getArc(name): Arc
  • Parameters

    • name: string

    Returns Arc

    the Arc with the given name

Protected getBroadcast

  • getBroadcast(): boolean
  • Returns boolean

    whether broadcasting is enabled for this Subject

getClassName

  • getClassName(): string
  • Returns string

    name of class of this object.

getConcreteLine

getMassObject

  • getMassObject(name): MassObject
  • Parameters

    • name: string

    Returns MassObject

    the MassObject with the given name

getName

  • getName(): string
  • Returns string

    name the language-independent name of this Subject

getObservers

  • getObservers(): Observer[]
  • Returns Observer[]

    a copy of the list of Observers of this Subject.

getParameter

  • getParameter(name): Parameter
  • Parameters

    • name: string

    Returns Parameter

    the Parameter with the given name

getParameterBoolean

getParameterNumber

getParameterString

getParameters

  • getParameters(): Parameter[]
  • Returns Parameter[]

    a copy of the list of available Parameters for this Subject

getPointMass

  • getPointMass(name): PointMass
  • Parameters

    • name: string

    Returns PointMass

    the PointMass with the given name

getSimilar

  • getSimilar(simObj, tolerance?): null | SimObject
  • Parameters

    Returns null | SimObject

    a similar looking SimObject on this SimList, or null if there isn't one

getSpring

  • getSpring(name): Spring
  • Parameters

    • name: string

    Returns Spring

    the Spring with the given name

getTolerance

  • getTolerance(): number
  • Returns number

    the tolerance used for similarity testing when adding SimObjects

indexOf

  • indexOf(simObj): number
  • Returns number

    the index of the first occurrence of the specified SimObject in this list, or -1 if this list does not contain the SimObject

length

  • length(): number
  • Returns number

    the number of SimObjects in this SimList.

remove

  • remove(simObj): void
  • Returns void

removeAll

  • removeAll(objList): void
  • Returns void

removeObserver

  • removeObserver(observer): void
  • Returns void

removeParameter

  • removeParameter(parameter): void
  • Returns void

removeTemporary

  • removeTemporary(time): void
  • Parameters

    • time: number

    Returns void

Protected setBroadcast

  • setBroadcast(value): boolean
  • Parameters

    • value: boolean

    Returns boolean

    the previous value

setTolerance

  • setTolerance(tolerance): void
  • Parameters

    • tolerance: number

    Returns void

toArray

  • toArray(): SimObject[]
  • Returns SimObject[]

    an array containing all the SimObjects on this SimList.

toString

  • toString(): string
  • Returns string

toStringShort

  • toStringShort(): string
  • Returns string

    a minimal string representation of this object.