Skip to main content

ArrayList

An object to represent a list of values in an array.

Properties

IsFixedSize

ArrayList.IsFixedSize: boolean

Whether or not the ArrayList is fixed size. Defaults to false.

IsReadOnly

ArrayList.IsReadOnly: boolean

Whether or not the ArrayList is read-only. Defaults to false.

Length

ArrayList.Length: number

The length of the ArrayList.

Functions

new

ArrayList.new() → ArrayList<T>

Creates a new ArrayList.

FromCapacity

ArrayList.FromCapacity(
Capacity: int--

The capacity of the ArrayList.

) → ArrayList<T>

Creates a new ArrayList with the given capacity.

FromArray

ArrayList.FromArray(
Array: Array<T>--

The array to use as the source. This makes a shallow copy.

) → ArrayList<T>

Creates a new ArrayList from the given array. Will not mutate the original array.

Is

ArrayList.Is(
Value: any--

The value to check.

) → boolean

Determines if the passed Value is an ArrayList.

MarkReadOnly

ArrayList.MarkReadOnly(
List: ArrayList<T>--

The ArrayList to make read-only.

) → ArrayList<T>

Marks the ArrayList as read-only. Returns a clone of the ArrayList.

Errors

TypeDescription
"InvalidArgument"Thrown when the List is nil.
"NotArrayList"Thrown when the List isn't an ArrayList.

MarkFixedSize

ArrayList.MarkFixedSize(
List: ArrayList<T>--

The ArrayList to mark as fixed size.

) → ArrayList<T>

Marks the ArrayList as a fixed size. Returns a clone of the ArrayList.

Errors

TypeDescription
"InvalidArgument"Thrown when the List is nil.
"NotArrayList"Thrown when the List isn't an ArrayList.

Add

ArrayList:Add(
Value: NonNil--

The value to be added to the end of the ArrayList. The value cannot be nil.

) → int--

The ArrayList index at which the value has been added.

Adds an object to the end of the ArrayList.

Errors

TypeDescription
"IsFixedSize"Thrown when the ArrayList is fixed size.
"IsReadOnly"Thrown when the ArrayList is read-only.
"InvalidArgument"Thrown when the value is nil.

Clone

ArrayList:Clone() → ArrayList<T>--

A shallow copy of the ArrayList.

Creates a shallow copy of the ArrayList.

Clear

ArrayList:Clear() → ()

Clears the ArrayList.

Errors

TypeDescription
"IsFixedSize"Thrown when the ArrayList is fixed size.
"IsReadOnly"Thrown when the ArrayList is read-only.

Contains

ArrayList:Contains(
Value: NonNil--

The value to check.

) → boolean

Determines if the ArrayList contains the given value.

Errors

TypeDescription
"InvalidArgument"Thrown when the value is nil.

IndexOf

ArrayList:IndexOf(
Value: NonNil--

The value to search for.

) → int?--

The index of the value.

Locates the index of the given value in the ArrayList.

Errors

TypeDescription
"InvalidArgument"Thrown when the value is nil.

Insert

ArrayList:Insert(
Index: int,--

The index to insert at.

Value: NonNil--

The value to be added to the end of the ArrayList. The value cannot be nil.

) → ()

Inserts the given value into the ArrayList at the given index.

Errors

TypeDescription
"IsFixedSize"Thrown when the ArrayList is fixed size.
"IsReadOnly"Thrown when the ArrayList is read-only.
"InvalidArgument"Thrown when either the value or the index is incorrect.
Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new ArrayList.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 39,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "FromCapacity",
            "desc": "Creates a new ArrayList with the given capacity.",
            "params": [
                {
                    "name": "Capacity",
                    "desc": "The capacity of the ArrayList.",
                    "lua_type": "int"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 52,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "FromArray",
            "desc": "Creates a new ArrayList from the given array. Will not mutate the original array.",
            "params": [
                {
                    "name": "Array",
                    "desc": "The array to use as the source. This makes a shallow copy.",
                    "lua_type": "Array<T>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Is",
            "desc": "Determines if the passed Value is an ArrayList.",
            "params": [
                {
                    "name": "Value",
                    "desc": "The value to check.",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 81,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "MarkReadOnly",
            "desc": "Marks the ArrayList as read-only. Returns a clone of the ArrayList.",
            "params": [
                {
                    "name": "List",
                    "desc": "The ArrayList to make read-only.",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when the List is nil."
                },
                {
                    "lua_type": "\"NotArrayList\"",
                    "desc": "Thrown when the List isn't an ArrayList."
                }
            ],
            "source": {
                "line": 93,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "MarkFixedSize",
            "desc": "Marks the ArrayList as a fixed size. Returns a clone of the ArrayList.",
            "params": [
                {
                    "name": "List",
                    "desc": "The ArrayList to mark as fixed size.",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when the List is nil."
                },
                {
                    "lua_type": "\"NotArrayList\"",
                    "desc": "Thrown when the List isn't an ArrayList."
                }
            ],
            "source": {
                "line": 115,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds an object to the end of the ArrayList.",
            "params": [
                {
                    "name": "Value",
                    "desc": "The value to be added to the end of the ArrayList. The value cannot be nil.",
                    "lua_type": "NonNil"
                }
            ],
            "returns": [
                {
                    "desc": "The ArrayList index at which the value has been added.",
                    "lua_type": "int"
                }
            ],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"IsFixedSize\"",
                    "desc": "Thrown when the ArrayList is fixed size."
                },
                {
                    "lua_type": "\"IsReadOnly\"",
                    "desc": "Thrown when the ArrayList is read-only."
                },
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when the value is nil."
                }
            ],
            "source": {
                "line": 138,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Clone",
            "desc": "Creates a shallow copy of the ArrayList.",
            "params": [],
            "returns": [
                {
                    "desc": "A shallow copy of the ArrayList.",
                    "lua_type": "ArrayList<T>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 161,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Clear",
            "desc": "Clears the ArrayList.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"IsFixedSize\"",
                    "desc": "Thrown when the ArrayList is fixed size."
                },
                {
                    "lua_type": "\"IsReadOnly\"",
                    "desc": "Thrown when the ArrayList is read-only."
                }
            ],
            "source": {
                "line": 174,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Contains",
            "desc": "Determines if the ArrayList contains the given value.",
            "params": [
                {
                    "name": "Value",
                    "desc": "The value to check.",
                    "lua_type": "NonNil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when the value is nil."
                }
            ],
            "source": {
                "line": 196,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "IndexOf",
            "desc": "Locates the index of the given value in the ArrayList.",
            "params": [
                {
                    "name": "Value",
                    "desc": "The value to search for.",
                    "lua_type": "NonNil"
                }
            ],
            "returns": [
                {
                    "desc": "The index of the value.",
                    "lua_type": "int?"
                }
            ],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when the value is nil."
                }
            ],
            "source": {
                "line": 211,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Insert",
            "desc": "Inserts the given value into the ArrayList at the given index.",
            "params": [
                {
                    "name": "Index",
                    "desc": "The index to insert at.",
                    "lua_type": "int"
                },
                {
                    "name": "Value",
                    "desc": "The value to be added to the end of the ArrayList. The value cannot be nil.",
                    "lua_type": "NonNil"
                }
            ],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"IsFixedSize\"",
                    "desc": "Thrown when the ArrayList is fixed size."
                },
                {
                    "lua_type": "\"IsReadOnly\"",
                    "desc": "Thrown when the ArrayList is read-only."
                },
                {
                    "lua_type": "\"InvalidArgument\"",
                    "desc": "Thrown when either the value or the index is incorrect."
                }
            ],
            "source": {
                "line": 228,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "IsFixedSize",
            "desc": "Whether or not the ArrayList is fixed size. Defaults to `false`.",
            "lua_type": "boolean",
            "source": {
                "line": 22,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "IsReadOnly",
            "desc": "Whether or not the ArrayList is read-only. Defaults to `false`.",
            "lua_type": "boolean",
            "source": {
                "line": 28,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        },
        {
            "name": "Length",
            "desc": "The length of the ArrayList.",
            "lua_type": "number",
            "source": {
                "line": 34,
                "path": "src/DataStructures/ArrayList/init.lua"
            }
        }
    ],
    "types": [],
    "name": "ArrayList",
    "desc": "An object to represent a list of values in an array.",
    "source": {
        "line": 8,
        "path": "src/DataStructures/ArrayList/init.lua"
    }
}