Home Reference Source
import HashMatrix from 'incarnate/src/HashMatrix.jsx'
public class | source

HashMatrix

Extends:

src/ConfigurableInstance.js~ConfigurableInstance → HashMatrix

Easily manage a data structure that can be dynamically built from paths with out throwing errors for accessing undefined portions of the structure.

Static Member Summary

Static Public Members
public static
public static
public static

ERRORS: *

Static Method Summary

Static Public Methods
public static

keyIsNumeric(key: *): *

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

hashMatrix: Object<*> | HashMatrix

An automatically maintained structure that acts as the source of all values.

public

name: string

The name of this HashMatrix.

public

pathDelimiter: string

The string used to delimit all paths.

public

targetPath: Array | string

The target path for a proxied HashMatrix.

Private Members
private
private

Method Summary

Public Methods
public

addChangeHandler(path: string, handler: *): *

public

addErrorHandler(path: string, handler: *): *

public

dispatchChanges(path: *)

public

dispatchErrors(error: *, path: *)

public

getBasePathArray(path: string): *

public

getChangeHandlerList(path: *): *

public

getErrorHandlerList(path: *): *

public

getPath(path: *): *

public

getPathArray(path: string, prefixPath: string): undefined[]

public

getPathString(path: *, prefixPath: *): *

public

getValue(): *

public
public

invalidatePath(path: *)

public

onChange(path: *, causePath: *)

public

onError(error: *, path: *, causePath: *)

public

removeChangeHandler(path: string, handler: *): *

public

removeErrorHandler(path: string, handler: *): *

public

setChangeHandlerList(path: *, handlerList: *[])

public

setError(path: *, error: *): *

public

setErrorHandlerList(path: *, handlerList: *[])

public

setPath(path: *, value: *): *

public

setValue(value: *): *

Private Methods
private

_getPathInternal(path: *): *

private
private

_setErrorInternal(path: *, error: *): *

private

_setPathInternal(path: *, value: *): *

Static Public Members

public static DEFAULT_NAME: * source

public static DEFAULT_PATH_DELIMITER: * source

public static ERRORS: * source

Static Public Methods

public static keyIsNumeric(key: *): * source

Params:

NameTypeAttributeDescription
key *

Return:

*

Public Constructors

public constructor() source

Public Members

public hashMatrix: Object<*> | HashMatrix source

An automatically maintained structure that acts as the source of all values. If set a to a HashMatrix, it will be proxied.

public name: string source

The name of this HashMatrix.

public pathDelimiter: string source

The string used to delimit all paths.

public targetPath: Array | string source

The target path for a proxied HashMatrix.

Private Members

private _changeHandlerMap: * source

private _errorHandlerMap: * source

Public Methods

public addChangeHandler(path: string, handler: *): * source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:
handler *

Return:

*

public addErrorHandler(path: string, handler: *): * source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:
handler *

Return:

*

public dispatchChanges(path: *) source

Params:

NameTypeAttributeDescription
path *

public dispatchErrors(error: *, path: *) source

Params:

NameTypeAttributeDescription
error *
path *

public getBasePathArray(path: string): * source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:

Return:

*

public getChangeHandlerList(path: *): * source

Params:

NameTypeAttributeDescription
path *

Return:

*

public getErrorHandlerList(path: *): * source

Params:

NameTypeAttributeDescription
path *

Return:

*

public getPath(path: *): * source

Params:

NameTypeAttributeDescription
path *

Return:

*

public getPathArray(path: string, prefixPath: string): undefined[] source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:
prefixPath string
  • optional
  • default:

Return:

undefined[]

public getPathString(path: *, prefixPath: *): * source

Params:

NameTypeAttributeDescription
path *
prefixPath *

Return:

*

public getValue(): * source

Return:

*

public invalidate() source

public invalidatePath(path: *) source

Params:

NameTypeAttributeDescription
path *

public onChange(path: *, causePath: *) source

Params:

NameTypeAttributeDescription
path *
causePath *

public onError(error: *, path: *, causePath: *) source

Params:

NameTypeAttributeDescription
error *
path *
causePath *

public removeChangeHandler(path: string, handler: *): * source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:
handler *

Return:

*

public removeErrorHandler(path: string, handler: *): * source

Params:

NameTypeAttributeDescription
path string
  • optional
  • default:
handler *

Return:

*

public setChangeHandlerList(path: *, handlerList: *[]) source

Params:

NameTypeAttributeDescription
path *
handlerList *[]
  • optional
  • default: []

public setError(path: *, error: *): * source

Params:

NameTypeAttributeDescription
path *
error *

Return:

*

public setErrorHandlerList(path: *, handlerList: *[]) source

Params:

NameTypeAttributeDescription
path *
handlerList *[]
  • optional
  • default: []

public setPath(path: *, value: *): * source

Params:

NameTypeAttributeDescription
path *
value *

Return:

*

public setValue(value: *): * source

Params:

NameTypeAttributeDescription
value *

Return:

*

Private Methods

private _getPathInternal(path: *): * source

Params:

NameTypeAttributeDescription
path *

Return:

*

private _setDefaultName() source

private _setErrorInternal(path: *, error: *): * source

Params:

NameTypeAttributeDescription
path *
error *

Return:

*

private _setPathInternal(path: *, value: *): * source

Params:

NameTypeAttributeDescription
path *
value *

Return:

*