Class List

Data structure that allows for fast removal at the cost of containing order.

Methods

List:new () Creates a new List.
List:add (obj) Adds an object to the List.
List:remove (obj) Removes an object from the List.
List:clear () Clears the List completely.
List:has (obj) Returns true if the List has the object.
List:get (i) Returns the object at an index.
List:indexOf (obj) Returns the index of an object in the List.


Methods

List:new ()
Creates a new List.

Returns:

    List A new List
List:add (obj)
Adds an object to the List. Object must be of reference type Object may not be the string 'size'

Parameters:

  • obj Object to add

Returns:

    List self
List:remove (obj)
Removes an object from the List.

Parameters:

  • obj Object to remove

Returns:

    List self
List:clear ()
Clears the List completely.

Returns:

    List self
List:has (obj)
Returns true if the List has the object.

Parameters:

  • obj Object to check for

Returns:

    boolean
List:get (i)
Returns the object at an index.

Parameters:

  • i number Index to get from

Returns:

    Object at the index
List:indexOf (obj)
Returns the index of an object in the List.

Parameters:

  • obj Object to get index of

Returns:

    number index of object in the List.
generated by LDoc 1.4.6 Last updated 2020-08-18 15:20:32