StackedMemory class
MemoryInterface の Stack 実装。 メモリ変数には階層関係があります。
- Extends
-
Array<MemoryInterface>
プロパティ
Array |
継承されたプロパティ
length | 配列の長さを取得または設定します。 これは、配列で定義されている最も高い要素より 1 つ上の数値です。 |
メソッド
get |
指定したパスから値を取得します。 |
set |
指定したパスに値を設定します。 |
version() | 現在の StackedMemoryのバージョンを取得します。 |
wrap(Memory |
MemoryInterface を実装するオブジェクトを、StackedMemory オブジェクトにラップします。 |
継承されたメソッド
プロパティの詳細
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()
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 を返すまで、または配列の末尾まで、配列 1 内の各要素に対して callbackfn 関数を呼び出します。
- thisArg
-
any
callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。
戻り値
boolean
配列から継承.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 つの引数を受け取る関数。 このフィルター メソッドは、配列内の各要素に対して 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 つの引数を受け取る関数。 このフィルター メソッドは、配列内の各要素に対して 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
配列の新しい要素。
戻り値
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()
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 を返すか、配列の末尾まで、配列 1 内の各要素に対して callbackfn 関数を呼び出します。
- thisArg
-
any
callbackfn 関数でこのキーワードが参照できるオブジェクト。 thisArg を省略すると、この値として undefined が使用されます。
戻り値
boolean
配列から継承された します。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
削除された要素の代わりに配列に挿入する要素。
戻り値
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
配列の先頭に挿入する要素。
戻り値
number
array.unshift から継承