public final class SparseArray extends DynamicArray
DynamicArray.DynamicArrayCacheScriptArray.DefaultIterator, ScriptArray.ProfileAccess, ScriptArray.ProfileHolder, ScriptArray.SetLengthProfileAccesscache, INTEGRITY_LEVEL_FROZEN, INTEGRITY_LEVEL_FROZEN_LENGTH_READONLY, INTEGRITY_LEVEL_MASK, INTEGRITY_LEVEL_NONE, INTEGRITY_LEVEL_NONE_LENGTH_READONLY, INTEGRITY_LEVEL_NOT_EXTENSIBLE, INTEGRITY_LEVEL_NOT_EXTENSIBLE_LENGTH_READONLY, INTEGRITY_LEVEL_SEALED, INTEGRITY_LEVEL_SEALED_LENGTH_READONLY, INTEGRITY_LEVELS, integrityLevel, LENGTH_NOT_WRITABLE, LENGTH_WRITABLE_MASKEMPTY_OBJECT_ARRAY, SET_LENGTH_PROFILE| Modifier and Type | Method and Description |
|---|---|
ScriptArray |
addRangeImpl(com.oracle.truffle.api.object.DynamicObject object,
long offset,
int size)
This method grows the array by adding more elements of a given size.
|
Object |
cloneArray(com.oracle.truffle.api.object.DynamicObject object) |
protected static void |
copyArrayToMap(com.oracle.truffle.api.object.DynamicObject object,
ScriptArray fromArray,
Map<Long,Object> toMap) |
static TreeMap<Long,Object> |
createArrayMap() |
static SparseArray |
createSparseArray() |
ScriptArray |
deleteElementImpl(com.oracle.truffle.api.object.DynamicObject object,
long index,
boolean strict) |
long |
firstElementIndex(com.oracle.truffle.api.object.DynamicObject object)
First element index (inclusive).
|
Object |
getElement(com.oracle.truffle.api.object.DynamicObject object,
long index) |
Object |
getElementInBounds(com.oracle.truffle.api.object.DynamicObject object,
long index) |
boolean |
hasElement(com.oracle.truffle.api.object.DynamicObject object,
long index) |
boolean |
hasHoles(com.oracle.truffle.api.object.DynamicObject object) |
boolean |
isHolesType()
Returns true when the this array could have hole values in it.
|
long |
lastElementIndex(com.oracle.truffle.api.object.DynamicObject object)
Last element index (inclusive).
|
long |
length(com.oracle.truffle.api.object.DynamicObject object) |
int |
lengthInt(com.oracle.truffle.api.object.DynamicObject object) |
static SparseArray |
makeSparseArray(com.oracle.truffle.api.object.DynamicObject object,
ScriptArray fromArray) |
long |
nextElementIndex(com.oracle.truffle.api.object.DynamicObject object,
long index)
Returns the next index.
|
List<Object> |
ownPropertyKeys(com.oracle.truffle.api.object.DynamicObject object) |
long |
previousElementIndex(com.oracle.truffle.api.object.DynamicObject object,
long index)
Returns the previous index.
|
ScriptArray |
removeRangeImpl(com.oracle.truffle.api.object.DynamicObject object,
long start,
long end)
This function deletes all elements in the range from [start..end[.
|
ScriptArray |
setElementImpl(com.oracle.truffle.api.object.DynamicObject object,
long index,
Object value,
boolean strict) |
SparseArray |
setLengthImpl(com.oracle.truffle.api.object.DynamicObject object,
long len,
ScriptArray.ProfileHolder profile) |
Object[] |
toArray(com.oracle.truffle.api.object.DynamicObject object)
Creates an Object[] from this array, of size array.length.
|
protected DynamicArray |
withIntegrityLevel(int newIntegrityLevel) |
array, createCache, freeze, isExtensible, isFrozen, isLengthNotWritable, isSealed, preventExtensions, seal, setIntegrityLevel, setLengthNotWritable, toStringaddRange, asIterable, canDeleteElement, cast, createConstantArray, createConstantEmptyArray, createSetLengthProfile, deleteElement, isInBoundsFast, isInstance, makeMultiRangeList, makeRangeList, nextPower, ownPropertyKeysContiguous, ownPropertyKeysHoles, removeRange, removeRange, setElement, setLength, setLength, toString, traceArrayTransition, traceWrite, valueIsBytepublic static SparseArray createSparseArray()
public static SparseArray makeSparseArray(com.oracle.truffle.api.object.DynamicObject object, ScriptArray fromArray)
protected static void copyArrayToMap(com.oracle.truffle.api.object.DynamicObject object,
ScriptArray fromArray,
Map<Long,Object> toMap)
public Object getElement(com.oracle.truffle.api.object.DynamicObject object, long index)
getElement in class ScriptArraypublic Object getElementInBounds(com.oracle.truffle.api.object.DynamicObject object, long index)
getElementInBounds in class ScriptArraypublic ScriptArray setElementImpl(com.oracle.truffle.api.object.DynamicObject object, long index, Object value, boolean strict)
setElementImpl in class ScriptArraypublic long length(com.oracle.truffle.api.object.DynamicObject object)
length in class ScriptArraypublic int lengthInt(com.oracle.truffle.api.object.DynamicObject object)
lengthInt in class ScriptArraypublic SparseArray setLengthImpl(com.oracle.truffle.api.object.DynamicObject object, long len, ScriptArray.ProfileHolder profile)
setLengthImpl in class ScriptArraypublic long firstElementIndex(com.oracle.truffle.api.object.DynamicObject object)
ScriptArrayfirstElementIndex in class ScriptArraypublic long lastElementIndex(com.oracle.truffle.api.object.DynamicObject object)
ScriptArraylastElementIndex in class ScriptArraypublic long nextElementIndex(com.oracle.truffle.api.object.DynamicObject object,
long index)
ScriptArraynextElementIndex in class ScriptArraypublic long previousElementIndex(com.oracle.truffle.api.object.DynamicObject object,
long index)
ScriptArraypreviousElementIndex in class ScriptArraypublic Object[] toArray(com.oracle.truffle.api.object.DynamicObject object)
ScriptArraytoArray in class ScriptArraypublic Object cloneArray(com.oracle.truffle.api.object.DynamicObject object)
cloneArray in class DynamicArraypublic ScriptArray deleteElementImpl(com.oracle.truffle.api.object.DynamicObject object, long index, boolean strict)
deleteElementImpl in class ScriptArraypublic boolean hasElement(com.oracle.truffle.api.object.DynamicObject object,
long index)
hasElement in class ScriptArraypublic boolean isHolesType()
ScriptArrayisHolesType in class ScriptArraypublic boolean hasHoles(com.oracle.truffle.api.object.DynamicObject object)
hasHoles in class ScriptArraypublic ScriptArray removeRangeImpl(com.oracle.truffle.api.object.DynamicObject object, long start, long end)
ScriptArrayremoveRangeImpl in class ScriptArraypublic ScriptArray addRangeImpl(com.oracle.truffle.api.object.DynamicObject object, long offset, int size)
ScriptArrayaddRangeImpl in class ScriptArrayoffset - starting offset positionsize - size of the inserted empty arrayScriptArray instance with the new sizepublic List<Object> ownPropertyKeys(com.oracle.truffle.api.object.DynamicObject object)
ownPropertyKeys in class ScriptArrayprotected DynamicArray withIntegrityLevel(int newIntegrityLevel)
withIntegrityLevel in class DynamicArray