A chunk of "alchemy memory" for storing 32-bit signed integers.

Constructor

@:value({ name : null })new (size:Int, ?name:String)

Creates a byte array capable of storing a total of size integers.

Variables

read onlysize:Int

The size measured in integers.

Methods

clone ():IntMemory

Creates a deep copy of this object.

inlineget (i:Int):Int

Returns the integer at index i.

inlinegetAddr (i:Int):Int

Returns the memory byte offset of the first byte storing the integer at index i.

resize (newSize:Int):Void

Adjusts the size of this object so it's capable of storing newSize integers.

inlineset (i:Int, x:Int):Void

Replaces the integer at the index i with the integer x.

setAll (x:Int):IntMemory

Sets all integers to the value x.

inlineswap (i:Int, j:Int):Void

Swaps the integer at index i with the integer at index j.

toString ():String

Prints out all elements.

Static methods

staticblit (src:IntMemory, srcPos:Int, dst:IntMemory, dstPos:Int, len:Int):Void

@:value({ max : -1, min : -1 })staticofArray (input:Array<Int>, min:Int = -1, max:Int = -1):IntMemory

Converts input in the range [min, max] to an IntMemory object. If no range is specified, all input values are copied.

@param min index pointing to the first integer.

Parameters:

max

index pointing to the last integer.

@:value({ max : -1, min : -1 })staticofByteArray (input:ByteArray, min:Int = -1, max:Int = -1):IntMemory

Converts input in the range [min, max] to an IntMemory object. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the byte storing the first integer.

min

index pointing to the byte storing the last integer.

@:value({ max : -1, min : -1 })staticofBytesData (input:BytesData, min:Int = -1, max:Int = -1):IntMemory

Converts input in the range [min, max] to an IntMemory object. If no range is specified, all input bytes are copied.

Parameters:

min

index pointing to the byte storing the first integer.

min

index pointing to the byte storing the last integer.

@:value({ max : -1, min : -1 })staticofVector (input:Vector<Int>, min:Int = -1, max:Int = -1):IntMemory

Converts input in the range [min, max] to an IntMemory object. If no range is specified, all input values are copied.

@param min index pointing to the first integer.

Parameters:

max

index pointing to the last integer.

@:value({ max : -1, min : -1 })statictoArray (input:IntMemory, min:Int = -1, max:Int = -1):Array<Int>

Converts input in the range [min, max] to an array. If no range is specified, all input bytes are copied.

@param min index pointing to the first integer.

Parameters:

max

index pointing to the last integer.

@:value({ max : -1, min : -1 })statictoByteArray (input:IntMemory, min:Int = -1, max:Int = -1):ByteArray

Converts input in the range [min, max] to a byte array. If no range is specified, all input bytes are copied. The bytes are written in little endian format.

Parameters:

min

index pointing to the first integer.

max

index pointing to the last integer.

@:value({ max : -1, min : -1 })statictoBytesData (input:IntMemory, min:Int = -1, max:Int = -1):BytesData

Converts input in the range [min, max] to a BytesData object. If no range is specified, all input bytes are copied. The bytes are written in little endian format.

Parameters:

min

index pointing to the first integer.

max

index pointing to the last integer.

@:value({ max : -1, min : -1 })statictoUnsignedVector (input:IntMemory, min:Int = -1, max:Int = -1):Vector<UInt>

Converts input in the range [min, max] to a vector object. If no range is specified, all input bytes are copied.

@param min index pointing to the first integer.

Parameters:

max

index pointing to the last integer.

@:value({ out : null, max : -1, min : -1 })statictoVector (input:IntMemory, min:Int = -1, max:Int = -1, ?out:Vector<Int>):Vector<Int>

Converts input in the range [min, max] to a vector object If no range is specified, all input bytes are copied.

@param min index pointing to the first integer.

Parameters:

max

index pointing to the last integer.

out

the Vector object to write into. If null, a new Vector object is created on-the-fly.

Inherited Variables

Defined by MemoryAccess

read onlybytes:Int

The number of allocated bytes.

@:value(HashKey.next())read onlykey:Int = HashKey.next()

A unique identifier for this object. A hash table transforms this key into an index of an array element by using a hash function.

name:String

read onlyoffset:Int

The memory offset in bytes.

Inherited Methods