import HalsteadArray from 'typhonjs-escomplex-commons/src/module/traits/HalsteadArray.js'
HalsteadArray
Provides a wrapper around an array of Halstead property object hashes which should contain an
identifier
field and potentially a filter
field.
Constructor Summary
Public Constructor | ||
public |
constructor(metric: string, data: Array<object | string>) Initializes HalsteadArray by normalizing any Halstead properties converting them into TraitHalstead instances. |
Member Summary
Public Members | ||
public get |
Returns the length of wrapped TraitHalstead data. |
|
public get |
Returns the associated metric type. |
|
public get |
Returns the typeof data being wrapped. |
Private Members | ||
private |
Stores an array of normalized Halstead property data to an object hash that has an |
|
private |
Stores the Halstead metric type. |
Method Summary
Public Methods | ||
public |
Allows custom processing of TraitHalstead data. |
|
public |
get(index: number): TraitHalstead Returns a TraitHalstead entry at the given index. |
|
public |
Returns an array of evaluated TraitHalstead data as the value of the |
Public Constructors
public constructor(metric: string, data: Array<object | string>) source
Initializes HalsteadArray by normalizing any Halstead properties converting them into TraitHalstead instances.
Params:
Name | Type | Attribute | Description |
metric | string | The name of Halstead metric being stored. |
|
data | Array<object | string> | An array of Halstead properties. |
Public Members
Private Members
private _data: Array<TraitHalstead> source
Stores an array of normalized Halstead property data to an object hash that has an identifier
entry.
Public Methods
public forEach(callback: function, thisArg: object) source
Allows custom processing of TraitHalstead data.
public get(index: number): TraitHalstead source
Returns a TraitHalstead entry at the given index.
Params:
Name | Type | Attribute | Description |
index | number | Index to access. |
public valueOf(params: *): Array<string> source
Returns an array of evaluated TraitHalstead data as the value of the identifier
field of the wrapped data.
Additionally the TraitHalstead filter function is invoked with the given parameters removing any values that
fail the filter test.
Params:
Name | Type | Attribute | Description |
params | * | Provides parameters which are forwarded onto any data stored as a function. Normally
|