Reference Source
public class | source

CollectorSingleton

You can directly use an instance of this class. Collector

Static Member Summary

Static Private Members
private static

The constructor of the Diob class

private static

Warning limit.

Constructor Summary

Private Constructor
private

Member Summary

Public Members
public

version: *

The version of the module.

Private Members
private

A default collection to use.

private

Collection limit on arrays.

private

The logger module this module uses to log errors / logs.

Method Summary

Public Methods
public

collect(pCollected: Object, pCollection: Array)

Collects a instance into a collection.

public

isInCollection(pType: string, pNum: number, pCollection: Array, pRest: ...any): Object

Gets diob instance(s) from the named ocllection and returns them.

public

setMaxLimit(pLimit: number)

Sets the max collection limit of this module.

Private Methods
private

Cleans the diob instance so it can be reused from a fresh state

Static Private Members

private static DiobConstructor: * source

The constructor of the Diob class

private static WARNING_LIMIT: number source

Warning limit.

Private Constructors

private constructor() source

Public Members

public version: * source

The version of the module.

Private Members

private basicCollection: Array source

A default collection to use.

private collectionLimit: number source

Collection limit on arrays.

private logger: Object source

The logger module this module uses to log errors / logs.

Public Methods

public collect(pCollected: Object, pCollection: Array) source

Collects a instance into a collection.

Params:

NameTypeAttributeDescription
pCollected Object

The instance to collect.

pCollection Array

The collection array to collect the instance to.

public isInCollection(pType: string, pNum: number, pCollection: Array, pRest: ...any): Object source

Gets diob instance(s) from the named ocllection and returns them. If no instances exist in the collection, a new one is created as a last resort.

Params:

NameTypeAttributeDescription
pType string

The diob type to find in the collection.

pNum number

How many of the diob instances to get from the collection.

pCollection Array

The collection to retrieve these instances from.

pRest ...any

Remaining args to be passed into the new constructor of the diob or onDumped event

Return:

Object

The diob instance that was

public setMaxLimit(pLimit: number) source

Sets the max collection limit of this module.

Params:

NameTypeAttributeDescription
pLimit number

The max limit of instances a collection can hold.

Private Methods

private cleanInstance(pDiob: Object) source

Cleans the diob instance so it can be reused from a fresh state

Params:

NameTypeAttributeDescription
pDiob Object

The diob instance to clean.