Class List
Data structure that allows for fast removal at the cost of containing order.
-
List:new ()
-
Creates a new List.
Returns:
List
A new List
-
List:has (obj)
-
Returns true if the List has the object.
Parameters:
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.
-
List:__add (obj)
-
Adds an object to the List.
Object must be of reference type
Object may not be the string 'size'
Parameters:
Returns:
List
self
-
List:__remove (obj)
-
Removes an object from the List.
Parameters:
Returns:
List
self
-
List:__clear ()
-
Clears the List completely.
Returns:
List
self