Number64BitArray

Package: Libraries.Containers · Inherits from: Libraries.Language.Object

The Array class is a data structure that stores items in contiguous memory. It is not intended to be used as a general purpose data structure and is solely for the purpose of optimizing the graphics engine on the backend. It does this by avoiding auto-boxing and not using the generics system.

Example Code

use Libraries.Containers.Number64BitArray
class Main
action Main
   //make the array
   Number64BitArray myArray
   //add a value
   myArray:Add(12)
   //get it back
   number value = myArray:Get(0)
end
end

Actions

Get(integer i)

This action gets the item at a given location in an array.

Parameters

  • i integer

Returns

number: The item at the given location.

Example

use Libraries.Containers.Number64BitArray
Number64BitArray myArray
myArray:SetSize(10)
myArray:Set(0, 22)
number result = myArray:Get(0)

GetSize()

This action gets the size of the array.

Returns

integer

Example

use Libraries.Containers.Number64BitArray
Number64BitArray myArray
integer size = myArray:GetSize()

Set(integer i, number n)

This action sets the item at a given location in the indexed object to a new item.

Parameters

  • i integer
  • n number

Example

use Libraries.Containers.Number64BitArray
Number64BitArray myArray
myArray:SetSize(10)
myArray:Set(0, 22)

SetSize(integer size)

This action sets the size of the array and fills it with undefined items. Changing the size of the array means any items already in the array will be copied over.

Parameters

  • size integer: The size of the array.

Example

use Libraries.Containers.Number64BitArray
Number64BitArray myArray
myArray:SetSize(10)

Inherited Actions

3 actions from Libraries.Language.Object