Options
All
  • Public
  • Public/Protected
  • All
Menu

Bese representation of a Boolean

export

Hierarchy

  • Obj<boolean>
    • Bool

Index

Constructors

Properties

_attribute_names: string[] = []

registered attribute names (in declaration order)

memberof

Model

_data: boolean
_date_last_modification: number = ...

"date" of previous change. We start at + 2 because we consider that an initialisation is a modification.

memberof

Model

_parents: Model[] = []

parent models (depending on this)

memberof

Model

_processes: Process[] = []

synchronized processes

memberof

Model

_server_id?: number

id unique from server. It doesn't exist at creation but added after a sync of the server

memberof

Model

model_id: number = ...

id of the model

memberof

Model

_constructorName: string = 'Bool'
static
memberof

Bool

Methods

  • _get_state(): string
  • _set(value: string | boolean | Bool): boolean
  • we do not take _set from Obj because we want a conversion if value is not a boolean

    memberof

    Bool

    Parameters

    • value: string | boolean | Bool

    Returns boolean

    {boolean}

  • _set_state(str: string, _map: unknown): boolean
  • _signal_change(change_level?: number): Timeout
  • called by set. change_level should not be defined by the user (it permits to != change from child of from this)

    memberof

    Model

    Parameters

    • change_level: number = 2

    Returns Timeout

    {ReturnType}

  • add_attr(object: {}): void
  • add_attr(name: string, instanceOfModel?: any, signal_change?: boolean): void
  • add attribute

    memberof

    Model

    Parameters

    • object: {}
      • [nameAttr: string]: any

    Returns void

  • add attribute

    memberof

    Model

    Parameters

    • name: string
    • Optional instanceOfModel: any
    • Optional signal_change: boolean

    Returns void

  • if this has been modified during the preceding round, f will be called If f is a process: process.onchange will be called each time this (or a child of this) will be modified. process.destructor will be called if this is destroyed. ... can be seen as a bind with an object

    memberof

    Model

    Parameters

    Returns Process

    {Process}

  • cosmetic_attribute(name: string): boolean
  • destructor(): void
  • Do nothing here, TBD in child if needed. Called in rem_attr if have no more parent.

    memberof

    Model

    Returns void

  • dim(_for_display?: number): number
  • dimensionnality of the object -> 0 for a scalar, 1 for a vector, ...

    memberof

    Model

    Parameters

    • _for_display: number = 0

    Returns number

    {number}

  • equals(obj: any): boolean
  • get(): boolean
  • get_parents_that_check(func_to_check: ((model: Model) => boolean)): Model[]
  • get_state(date?: number): string
  • return a string which describes the changes in this and children since date

    memberof

    Model

    Parameters

    • date: number = -1

    Returns string

    {string}

  • has_been_directly_modified(): boolean
  • has_been_modified(): boolean
  • mod_attr(name: string, instanceOfModel: any, signal_change?: boolean): void
  • change attribute named nname to instanceOfModel (use references for comparison)

    memberof

    Model

    Parameters

    • name: string
    • instanceOfModel: any
    • signal_change: boolean = true

    Returns void

    {void}

  • real_change(): boolean
  • rem_attr(name: string, signal_change?: boolean): void
  • remove attribute named name

    memberof

    Model

    Parameters

    • name: string
    • signal_change: boolean = true

    Returns void

  • set(value: any): boolean
  • modify data, using another values, or Model instances. Should not be redefined (but _set should be) returns true if object os modified

    memberof

    Model

    Parameters

    • value: any

    Returns boolean

    {boolean}

  • set_attr(instanceOfModel: {}): void
  • add / mod / rem attr to get the same data than o (assumed to be something like { key: val, ... })

    memberof

    Model

    Parameters

    • instanceOfModel: {}
      • [key: string]: any

    Returns void

  • set_state(str: string): void
  • modify state according to str. str can be the result of a previous @get_state

    memberof

    Model

    Parameters

    • str: string

    Returns void

  • size(_for_display?: number): number | number[]
  • dimension of the object -> [] for a scalar, [ length ] for a vector, [ nb_row, nb_cols ] for a matrix...

    memberof

    Model

    Parameters

    • _for_display: number = 0

    Returns number | number[]

    {(number | number[])}

  • toBoolean(): boolean
  • toString(): string
  • toggle(): boolean
  • toggle true / false ( 1 / 0 )

    memberof

    Bool

    Returns boolean

    {boolean}

Generated using TypeDoc