ArrayIndex,"\nArrayIndex( x[, options] )\n Wraps a provided array as an array index object.\n\n Array index instances have no explicit functionality; however, they are used\n by \"fancy\" arrays for element retrieval and assignment.\n\n By default, an instance is invalidated and removed from an internal cache\n immediately after a consumer resolves the underlying data associated with an\n instance using the `get` static method. Immediate invalidation and cache\n removal ensures that references to the underlying array are not the source\n of memory leaks.\n\n Because instances leverage an internal cache implementing the Singleton\n pattern, one must be sure to use the same constructor as consumers. If one\n uses a different constructor, the consumer will *not* be able to resolve the\n original wrapped array, as the consumer will attempt to resolve an instance\n in the wrong internal cache.\n\n Because non-persisted instances are freed after first use, in order to avoid\n holding onto memory and to allow garbage collection, one should avoid\n scenarios in which an instance is never used.\n\n Parameters\n ----------\n x: Array|TypedArray|Object\n Input array.\n\n options: Object (optional)\n Function options.\n\n options.persist: boolean (optional)\n Boolean indicating whether to continue persisting an index object after\n first usage. Default: false.\n\n Returns\n -------\n out: ArrayIndex\n ArrayIndex instance.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n\n\nArrayIndex.free( id )\n Frees the instance associated with a provided identifier.\n\n Parameters\n ----------\n id: string\n Instance identifier.\n\n Returns\n -------\n out: boolean\n Boolean indicating whether an instance was successfully freed.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > // ...\n > ArrayIndex.free( idx.id )\n\n\nArrayIndex.get( id )\n Returns the array associated with the instance having a provided identifier.\n\n Parameters\n ----------\n id: string\n Instance identifier.\n\n Returns\n -------\n out: Object\n Object containing array data.\n\n out.data: Array|TypedArray|Object\n The underlying array associated with the provided identifier.\n\n out.type: string\n The type of array index.\n\n out.dtype: string\n The data type of the underlying array.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > ArrayIndex.get( idx.id )\n {...}\n\n\nArrayIndex.prototype.data\n Read-only property returning the underlying index array.\n\n Returns\n -------\n out: Array|TypedArray|Object\n Array data type.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.data\n [ 1, 2, 3, 4 ]\n\n\nArrayIndex.prototype.dtype\n Read-only property returning the underlying data type of the index array.\n\n Returns\n -------\n out: string\n Array data type.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.dtype\n 'generic'\n\n\nArrayIndex.prototype.id\n Read-only property returning the unique identifier associated with an\n instance.\n\n Returns\n -------\n out: string\n String identifier.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.id\n <string>\n\n\nArrayIndex.prototype.isCached\n Read-only property returning a boolean indicating whether an array index is\n actively cached.\n\n Returns\n -------\n out: boolean\n Boolean indicating whether an array index is actively cached.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.isCached\n true\n\n\nArrayIndex.prototype.type\n Read-only property returning the array index type.\n\n Returns\n -------\n out: string\n Array index type.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.type\n <string>\n\n\nArrayIndex.prototype.toString()\n Serializes an instance as a string.\n\n Returns\n -------\n str: string\n Serialized string.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.toString()\n\n\nArrayIndex.prototype.toJSON()\n Serializes an instance as a JSON object.\n\n Returns\n -------\n obj: Object\n JSON object.\n\n Examples\n --------\n > var idx = new ArrayIndex( [ 1, 2, 3, 4 ] );\n > idx.toJSON()\n { 'type': 'ArrayIndex', 'data': [ 1, 2, 3, 4 ] }\n\n See Also\n --------\n array2fancy\n"
0 commit comments