Constructor
new Index(values)
Name | Type | Description |
---|---|---|
values | Array.<number> | The index values. |
- Source
Classes
Methods
add(rhs) → {Index}
Add another index to this one.
Name | Type | Description |
---|---|---|
rhs | Index | The index to add. |
- Source
The index representing the sum of both indices.
- Type:
- Index
canCompare(rhs) → {boolean}
Check if the input index can be compared to this one.
Name | Type | Description |
---|---|---|
rhs | Index | The index to compare to. |
- Source
True if both indices are comparable.
- Type:
- boolean
compare(rhs) → {Array.<number>}
Compare indices and return different dimensions.
Name | Type | Description |
---|---|---|
rhs | Index | The index to compare to. |
- Source
The list of different dimensions.
- Type:
- Array.<number>
equals(rhs) → {boolean}
Check for Index equality.
Name | Type | Description |
---|---|---|
rhs | Index | The index to compare to. |
- Source
True if both indices are equal.
- Type:
- boolean
get(i) → {number|undefined}
Get the index value at the given array index.
Name | Type | Description |
---|---|---|
i | number | The index to get. |
- Source
The value or undefined if not in range.
- Type:
- number |
undefined
getValues() → {Array.<number>}
Get the values of this index.
- Source
The array of values.
- Type:
- Array.<number>
getWithNew2D(i, j) → {Index}
Get the current index with a new 2D base.
Name | Type | Description |
---|---|---|
i | number | The new 0 index. |
j | number | The new 1 index. |
- Source
The new index.
- Type:
- Index
length() → {number}
Get the length of the index.
- Source
The length.
- Type:
- number
toString() → {string}
Get a string representation of the Index.
- Source
The Index as a string.
- Type:
- string
toStringId(dimsopt) → {string}
Get a string id from the index values in the form of: '#0-1_#1-2'.
Name | Type | Attributes | Description |
---|---|---|---|
dims | Array.<number> | <optional> | Optional list of dimensions to use. |
- Source
The string id.
- Type:
- string