Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObjectMap<T>

allows keeping track of objects

Type parameters

  • T

Hierarchy

  • ObjectMap

Index

Constructors

constructor

  • returns a new instance

    Type parameters

    • T

    Returns ObjectMap<T>

Properties

eventSubject

eventSubject: Subject<IObjectMapEventData<T>> = ...

Private fastMap

fastMap: FastMap<T> = ...

Methods

add

  • add(objectArg: T): string
  • add object to Objectmap returns false if the object is already in the map returns true if the object was added successfully

    Parameters

    • objectArg: T

    Returns string

addAllFromOther

  • addAllFromOther(objectMapArg: ObjectMap<T>): void
  • tries to merge another Objectmap Note: uniqueKeyCollisions will cause overwrite

    Parameters

    Returns void

addArray

  • addArray(objectArrayArg: T[]): void
  • like .add but adds an whole array of objects

    Parameters

    • objectArrayArg: T[]

    Returns void

addMappedUnique

  • addMappedUnique(uniqueKeyArg: string, objectArg: T): void
  • adds an object mapped to a string the string must be unique

    Parameters

    • uniqueKeyArg: string
    • objectArg: T

    Returns void

checkForObject

  • checkForObject(objectArg: T): boolean
  • check if object is in Objectmap

    Parameters

    • objectArg: T

    Returns boolean

concat

  • returns a new Objectmap that includes

    Parameters

    Returns ObjectMap<T>

find

  • find object

    Parameters

    Returns Promise<T>

findOneAndRemove

  • finds a specific element and then removes it

    Parameters

    Returns Promise<T>

findOneAndRemoveSync

findSync

forEach

  • run function for each item in Objectmap

    Parameters

    Returns Promise<void>

getArray

  • getArray(): T[]
  • returns a cloned array of all the objects currently in the Objectmap

    Returns T[]

getKeyForObject

  • getKeyForObject(objectArg: T): string
  • get key for object

    Parameters

    • objectArg: T

    Returns string

getMappedUnique

  • getMappedUnique(uniqueKeyArg: string): T
  • fastest way to get an object from the map

    Parameters

    • uniqueKeyArg: string

    Returns T

getOneAndRemove

  • getOneAndRemove(): T
  • gets an object in the Observablemap and removes it, so it can't be retrieved again

    Returns T

isEmpty

  • isEmpty(): boolean
  • check if Objectmap ist empty

    Returns boolean

remove

  • remove(objectArg: T): T
  • remove object from Objectmap

    Parameters

    • objectArg: T

    Returns T

removeMappedUnique

  • removeMappedUnique(uniqueKey: string): void
  • remove key

    Parameters

    • uniqueKey: string

    Returns void

wipe

  • wipe(): void
  • wipe Objectmap

    Returns void

Generated using TypeDoc