StackedMemory class

MemoryInterface の Stack 実装。 メモリ変数には階層リレーションシップがあります。

Extends

プロパティ

Array

継承されたプロパティ

length

配列の長さを取得または設定します。 これは配列内で定義されている最後の要素のインデックスより 1 だけ大きい数値です。

メソッド

getValue(string)

指定したパスから値を取得します。

setValue(string, any)

指定したパスに値を設定します。

version()

現在の StackedMemory のバージョンを取得します。

wrap(MemoryInterface)

MemoryInterface を実装するオブジェクトを StackedMemory オブジェクトにラップします。

継承されたメソッド

concat(ConcatArray<MemoryInterface>[])

2 つ以上の配列を結合します。

concat(T | ConcatArray<T>[])

2 つ以上の配列を結合します。

every((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

配列のすべてのメンバーが指定したテストを満たすかどうかを判断します。

filter((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

コールバック関数で指定された条件を満たす配列の要素を返します。

filter<S>((value: MemoryInterface, index: number, array: MemoryInterface[]) => boolean, any)

コールバック関数で指定された条件を満たす配列の要素を返します。

forEach((value: MemoryInterface, index: number, array: MemoryInterface[]) => void, any)

配列の各要素に対して、指定された処理を実行します。

indexOf(MemoryInterface, number)

ある値が配列内で最初に見つかった位置のインデックスを返します。

join(string)

指定した区切り文字列で区切られた配列のすべての要素を追加します。

lastIndexOf(MemoryInterface, number)

指定した値が配列内で最後に見つかった位置のインデックスを返します。

map<U>((value: MemoryInterface, index: number, array: MemoryInterface[]) => U, any)

定義されたコールバック関数を配列の各要素に対して呼び出し、結果を含む配列を返します。

pop()

配列の最後の要素を削除し、削除した要素を返します。

push(MemoryInterface[])

配列に新しい要素を追加し、その要素を追加した後の配列の長さを返します。

reduce((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface)

配列内のすべての要素に対して、指定したコールバック関数を呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

reduce((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, MemoryInterface)
reduce<U>((previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, U)

配列内のすべての要素に対して、指定したコールバック関数を呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

reduceRight((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface)

配列内のすべての要素に対して、指定したコールバック関数を降順で呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

reduceRight((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, MemoryInterface)
reduceRight<U>((previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, U)

配列内のすべての要素に対して、指定したコールバック関数を降順で呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

reverse()

配列内の要素を反転します。

shift()

配列の先頭の要素を削除し、削除した要素を返します。

slice(number, number)

配列の一部を返します。

some((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

指定したコールバック関数が配列の任意の要素に対して true を返すかどうかを判断します。

sort((a: MemoryInterface, b: MemoryInterface) => number)

配列を並べ替えます。

splice(number, number)

配列から要素を削除し、必要に応じて新しい要素を削除位置に挿入し、削除した要素を返します。

splice(number, number, MemoryInterface[])

配列から要素を削除し、必要に応じて新しい要素を削除位置に挿入し、削除した要素を返します。

toLocaleString()

配列の文字列表現を返します。 要素は、toLocalString メソッドを使用して文字列に変換されます。

toString()

配列の文字列表現を返します。

unshift(MemoryInterface[])

配列の先頭に新しい要素を挿入します。

プロパティの詳細

Array

static Array: ArrayConstructor

プロパティ値

ArrayConstructor

継承されたプロパティの詳細

length

配列の長さを取得または設定します。 これは配列内で定義されている最後の要素のインデックスより 1 だけ大きい数値です。

length: number

プロパティ値

number

継承元 Array.length

メソッドの詳細

getValue(string)

指定したパスから値を取得します。

function getValue(path: string): any

パラメーター

path

string

指定されたパス。

戻り値

any

見つかった場合は、指定されたパスからの値。それ以外の場合は未定義です。

setValue(string, any)

指定したパスに値を設定します。

function setValue(_path: string, _value: any)

パラメーター

_path

string

メモリ パス。

_value

any

設定する値。

version()

現在の StackedMemory のバージョンを取得します。

function version(): string

戻り値

string

バージョンを表す文字列値。

wrap(MemoryInterface)

MemoryInterface を実装するオブジェクトを StackedMemory オブジェクトにラップします。

static function wrap(memory: MemoryInterface): StackedMemory

パラメーター

memory
MemoryInterface

MemoryInterface を実装する オブジェクト。

戻り値

StackedMemory オブジェクト。

継承済みメソッドの詳細

concat(ConcatArray<MemoryInterface>[])

2 つ以上の配列を結合します。

function concat(items: ConcatArray<MemoryInterface>[]): MemoryInterface[]

パラメーター

items

ConcatArray<MemoryInterface>[]

配列 1 の末尾に追加する追加項目。

戻り値

継承元 Array.concat

concat(T | ConcatArray<T>[])

2 つ以上の配列を結合します。

function concat(items: T | ConcatArray<T>[]): MemoryInterface[]

パラメーター

items

T | ConcatArray<T>[]

配列 1 の末尾に追加する追加項目。

戻り値

継承元 Array.concat

every((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

配列のすべてのメンバーが指定したテストを満たすかどうかを判断します。

function every(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, thisArg?: any): boolean

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown

3 つまでの引数を受け取る関数。 callbackfn が false を返すまで、または配列の末尾まで、各メソッドは array1 内の各要素に対して callbackfn 関数を呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

戻り値

boolean

継承元 Array.every

filter((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

コールバック関数で指定された条件を満たす配列の要素を返します。

function filter(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, thisArg?: any): MemoryInterface[]

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown

3 つまでの引数を受け取る関数。 filter メソッドは、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

戻り値

継承元 Array.filter

filter<S>((value: MemoryInterface, index: number, array: MemoryInterface[]) => boolean, any)

コールバック関数で指定された条件を満たす配列の要素を返します。

function filter<S>(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => boolean, thisArg?: any): S[]

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => boolean

3 つまでの引数を受け取る関数。 filter メソッドは、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

戻り値

S[]

継承元 Array.filter

forEach((value: MemoryInterface, index: number, array: MemoryInterface[]) => void, any)

配列の各要素に対して、指定された処理を実行します。

function forEach(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => void, thisArg?: any)

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => void

3 つまでの引数を受け取る関数。 forEach は、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

継承元 Array.forEach

indexOf(MemoryInterface, number)

ある値が配列内で最初に見つかった位置のインデックスを返します。

function indexOf(searchElement: MemoryInterface, fromIndex?: number): number

パラメーター

searchElement
MemoryInterface

配列内で検索する値。

fromIndex

number

検索を開始する配列インデックス。 fromIndex を省略すると、検索はインデックス 0 から開始されます。

戻り値

number

継承元 Array.indexOf

join(string)

指定した区切り文字列で区切られた配列のすべての要素を追加します。

function join(separator?: string): string

パラメーター

separator

string

配列の 1 つの要素を、結果の String 内の次の要素から分離するために使用される文字列。 省略すると、配列要素はコンマで区切られます。

戻り値

string

継承元 Array.join

lastIndexOf(MemoryInterface, number)

指定した値が配列内で最後に見つかった位置のインデックスを返します。

function lastIndexOf(searchElement: MemoryInterface, fromIndex?: number): number

パラメーター

searchElement
MemoryInterface

配列内で検索する値。

fromIndex

number

検索を開始する配列インデックス。 fromIndex を省略すると、配列の最後のインデックスから検索が開始されます。

戻り値

number

継承元 Array.lastIndexOf

map<U>((value: MemoryInterface, index: number, array: MemoryInterface[]) => U, any)

定義されたコールバック関数を配列の各要素に対して呼び出し、結果を含む配列を返します。

function map<U>(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => U, thisArg?: any): U[]

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => U

3 つまでの引数を受け取る関数。 map メソッドは、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

戻り値

U[]

継承元 Array.map

pop()

配列の最後の要素を削除し、削除した要素を返します。

function pop(): MemoryInterface | undefined

戻り値

MemoryInterface | undefined

継承元 Array.pop

push(MemoryInterface[])

配列に新しい要素を追加し、その要素を追加した後の配列の長さを返します。

function push(items: MemoryInterface[]): number

パラメーター

items

MemoryInterface[]

配列の新しい要素。

戻り値

number

継承元 Array.push

reduce((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface)

配列内のすべての要素に対して、指定したコールバック関数を呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

function reduce(callbackfn: (previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface): MemoryInterface

パラメーター

callbackfn

(previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface

最大 4 つの引数を受け入れる関数。 reduce メソッドは、配列内の要素ごとに callbackfn 関数を 1 回呼び出します。

戻り値

継承元 Array.reduce

reduce((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, MemoryInterface)

function reduce(callbackfn: (previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, initialValue: MemoryInterface): MemoryInterface

パラメーター

callbackfn

(previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface

initialValue
MemoryInterface

戻り値

継承元 Array.reduce

reduce<U>((previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, U)

配列内のすべての要素に対して、指定したコールバック関数を呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

function reduce<U>(callbackfn: (previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, initialValue: U): U

パラメーター

callbackfn

(previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U

最大 4 つの引数を受け入れる関数。 reduce メソッドは、配列内の要素ごとに callbackfn 関数を 1 回呼び出します。

initialValue

U

initialValue を指定した場合は、累積を開始するための初期値として使用されます。 callbackfn 関数の最初の呼び出しでは、この値が配列値ではなく引数として提供されます。

戻り値

U

継承元 Array.reduce

reduceRight((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface)

配列内のすべての要素に対して、指定したコールバック関数を降順で呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

function reduceRight(callbackfn: (previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface): MemoryInterface

パラメーター

callbackfn

(previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface

最大 4 つの引数を受け入れる関数。 reduceRight メソッドは、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

戻り値

継承元 Array.reduceRight

reduceRight((previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, MemoryInterface)

function reduceRight(callbackfn: (previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface, initialValue: MemoryInterface): MemoryInterface

パラメーター

callbackfn

(previousValue: MemoryInterface, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => MemoryInterface

initialValue
MemoryInterface

戻り値

継承元 Array.reduceRight

reduceRight<U>((previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, U)

配列内のすべての要素に対して、指定したコールバック関数を降順で呼び出します。 コールバック関数の戻り値は収集された結果で、コールバック関数の次の呼び出しの引数として提供されます。

function reduceRight<U>(callbackfn: (previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U, initialValue: U): U

パラメーター

callbackfn

(previousValue: U, currentValue: MemoryInterface, currentIndex: number, array: MemoryInterface[]) => U

最大 4 つの引数を受け入れる関数。 reduceRight メソッドは、配列内の各要素に対して callbackfn 関数を 1 回呼び出します。

initialValue

U

initialValue を指定した場合は、累積を開始するための初期値として使用されます。 callbackfn 関数の最初の呼び出しでは、この値が配列値ではなく引数として提供されます。

戻り値

U

継承元 Array.reduceRight

reverse()

配列内の要素を反転します。

function reverse(): MemoryInterface[]

戻り値

継承元 Array.reverse

shift()

配列の先頭の要素を削除し、削除した要素を返します。

function shift(): MemoryInterface | undefined

戻り値

MemoryInterface | undefined

継承元 Array.shift

slice(number, number)

配列の一部を返します。

function slice(start?: number, end?: number): MemoryInterface[]

パラメーター

start

number

配列の指定した部分の先頭。

end

number

配列の指定した部分の末尾。

戻り値

継承元 Array.slice

some((value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, any)

指定したコールバック関数が配列の任意の要素に対して true を返すかどうかを判断します。

function some(callbackfn: (value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown, thisArg?: any): boolean

パラメーター

callbackfn

(value: MemoryInterface, index: number, array: MemoryInterface[]) => unknown

3 つまでの引数を受け取る関数。 一部のメソッドは、callbackfn が true を返すまで、または配列の末尾まで、array1 内の各要素に対して callbackfn 関数を呼び出します。

thisArg

any

callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。

戻り値

boolean

継承元 Array.some

sort((a: MemoryInterface, b: MemoryInterface) => number)

配列を並べ替えます。

function sort(compareFn?: (a: MemoryInterface, b: MemoryInterface) => number): this

パラメーター

compareFn

(a: MemoryInterface, b: MemoryInterface) => number

要素の順序を決定するために使用される関数の名前。 省略すると、要素は昇順、ASCII 文字順で並べ替えられます。

戻り値

this

継承元 Array.sort

splice(number, number)

配列から要素を削除し、必要に応じて新しい要素を削除位置に挿入し、削除した要素を返します。

function splice(start: number, deleteCount?: number): MemoryInterface[]

パラメーター

start

number

要素の削除を開始する配列内の 0 から始まる位置。

deleteCount

number

削除する要素の数を指定します。

戻り値

継承元 Array.splice

splice(number, number, MemoryInterface[])

配列から要素を削除し、必要に応じて新しい要素を削除位置に挿入し、削除した要素を返します。

function splice(start: number, deleteCount: number, items: MemoryInterface[]): MemoryInterface[]

パラメーター

start

number

要素の削除を開始する配列内の 0 から始まる位置。

deleteCount

number

削除する要素の数を指定します。

items

MemoryInterface[]

削除された要素の代わりに配列に挿入する要素。

戻り値

継承元 Array.splice

toLocaleString()

配列の文字列表現を返します。 要素は、toLocalString メソッドを使用して文字列に変換されます。

function toLocaleString(): string

戻り値

string

継承元 Array.toLocaleString

toString()

配列の文字列表現を返します。

function toString(): string

戻り値

string

継承元 Array.toString

unshift(MemoryInterface[])

配列の先頭に新しい要素を挿入します。

function unshift(items: MemoryInterface[]): number

パラメーター

items

MemoryInterface[]

配列の先頭に挿入する要素。

戻り値

number

継承元 Array.unshift