public class HashList<T>
HashLists are used if you require quick contains operations on a large list object. LinkedLists should be generally used, but are slow in this regard. Removing elements from a HashList is slower than of LinkedLists.
construct()construct(thistype base)Create a new list by copying all elements from another list into it
count(T elem) returns intReturns the number of occurences of an element in this list
add(vararg T elems)Add an element to the end of the list
set(int index, T elem)Set an element at the given index. If the index is higher than the list’s size, the list will be resized with null elements added between the index and the previous size. Errors if the index is negative.
addAll(HashList<T> elems)Add all elements from elems to this list. Adding a list to itself duplicates its current contents.
clear()Remove all elements from this list without destroying it
removeAt(int index) returns TRemoves and returns the element at the given index. Errors if the index is outside [0, size).
remove(T t) returns booleanRemoves the first occurence of t from this list. Returns true if an element was removed from the list.
size() returns intGet the size of the list
isEmpty() returns boolReturn whether the list is empty
get(int index) returns TGet the element at the given index from this list. Indices outside [0, size) are not validated and yield the null/zero value.
has(T elem) returns boolReturn whether the element exists in the list
hasAt(int index) returns boolReturn whether the given index is valid, i.e. inside [0, size)
iterator() returns HLIterator<T>Get an iterator for this list
copy() returns HashList<T>Returns a shallow copy of this list
forEach(HLItrClosure<T> itr) returns HashList<T>Executes the closure for each element
staticItr() returns HLIterator<T>get the static iterator for this list
removeIf(RemovePredicate<T> predicate)Removes the element if the predicates returns true. Single pass compaction - removing through the iterator instead would shift the tail once per removal, making this O(n^2).
getRandomElement() returns T