HashSet

Data Structures View source
HashSet
public class HashSet<T> extends HashList<T>

Generic set implementation

Inherits from: HashList · See this type for inherited members.

Methods

override function add(vararg T elems)

Adds an element to this set

override function set(int index, T elem)

Replaces an element or appends at size(). An already-present value is a no-op. Sparse indexes are rejected: repeated null padding would violate set uniqueness.

override function remove(T elem) returns boolean

Removes an element from this set if present

override function removeAt(int index) returns T

Remove the element at the given index. Indices outside [0, size) are an error.

override function removeIf(RemovePredicate<T> predicate)

Removes matching elements in linear time and rebuilds the compacted indexes.

override function clear()