Top Description Methods
org.graalvm.collections

public Interface EconomicSet<E>

extends UnmodifiableEconomicSet<E>
Known Direct Implementers
org.graalvm.collections.EconomicMapImpl
Imports
java.util.Iterator

Memory efficient set data structure.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this set did not already contain element.
add
(E element)

Adds element to this set if it is not already present.

public default void
addAll(EconomicSet<E> other)

Adds all of the elements in other to this set if they're not already present.

public default void
addAll(Iterable<E> values)

Adds all of the elements in values to this set if they're not already present.

public default void
addAll(Iterator<E> iterator)

Adds all of the elements enumerated by iterator to this set if they're not already present.

public void
clear()

Removes all of the elements from this set.

public static <E> EconomicSet<E>
create()

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy.

public static <E> EconomicSet<E>
create(Equivalence strategy)

Creates a new set guaranteeing insertion order when iterating over its elements.

public static <E> EconomicSet<E>
create(int initialCapacity)

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy and inserts all elements of the specified collection.

public static <E> EconomicSet<E>
create(UnmodifiableEconomicSet<E> c)

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy and inserts all elements of the specified collection.

public static <E> EconomicSet<E>
create(Equivalence strategy, int initialCapacity)

Creates a new set guaranteeing insertion order when iterating over its elements and initializes with the given capacity.

public static <E> EconomicSet<E>
create(Equivalence strategy, UnmodifiableEconomicSet<E> c)

Creates a new set guaranteeing insertion order when iterating over its elements and inserts all elements of the specified collection.

public void
remove(E element)

Removes element from this set if it is present.

public default void
removeAll(EconomicSet<E> other)

Removes from this set all of its elements that are contained in other.

public default void
removeAll(Iterable<E> values)

Removes from this set all of its elements that are contained in values.

public default void
removeAll(Iterator<E> iterator)

Removes from this set all of its elements that are enumerated by iterator.

public default void
retainAll(EconomicSet<E> other)

Removes from this set all of its elements that are not contained in other.

Inherited from org.graalvm.collections.UnmodifiableEconomicSet:
containsisEmptysizetoArray

Method Detail

addback to summary
public boolean add(E element)

Adds element to this set if it is not already present.

Returns:boolean

true if this set did not already contain element.

Since
19.0
addAllback to summary
public default void addAll(EconomicSet<E> other)

Adds all of the elements in other to this set if they're not already present.

Since
19.0
addAllback to summary
public default void addAll(Iterable<E> values)

Adds all of the elements in values to this set if they're not already present.

Since
19.0
addAllback to summary
public default void addAll(Iterator<E> iterator)

Adds all of the elements enumerated by iterator to this set if they're not already present.

Since
19.0
clearback to summary
public void clear()

Removes all of the elements from this set. The set will be empty after this call returns.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create()

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create(Equivalence strategy)

Creates a new set guaranteeing insertion order when iterating over its elements.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create(int initialCapacity)

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy and inserts all elements of the specified collection.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create(UnmodifiableEconomicSet<E> c)

Creates a new set guaranteeing insertion order when iterating over its elements with the default Equivalence#DEFAULT comparison strategy and inserts all elements of the specified collection.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create(Equivalence strategy, int initialCapacity)

Creates a new set guaranteeing insertion order when iterating over its elements and initializes with the given capacity.

Since
19.0
createback to summary
public static <E> EconomicSet<E> create(Equivalence strategy, UnmodifiableEconomicSet<E> c)

Creates a new set guaranteeing insertion order when iterating over its elements and inserts all elements of the specified collection.

Since
19.0
removeback to summary
public void remove(E element)

Removes element from this set if it is present. This set will not contain element once the call returns.

Since
19.0
removeAllback to summary
public default void removeAll(EconomicSet<E> other)

Removes from this set all of its elements that are contained in other.

Since
19.0
removeAllback to summary
public default void removeAll(Iterable<E> values)

Removes from this set all of its elements that are contained in values.

Since
19.0
removeAllback to summary
public default void removeAll(Iterator<E> iterator)

Removes from this set all of its elements that are enumerated by iterator.

Since
19.0
retainAllback to summary
public default void retainAll(EconomicSet<E> other)

Removes from this set all of its elements that are not contained in other.

Since
19.0