public final class ArrayKeySet<E extends Key> extends Object
e1
and e2
such that e1.equals(e2)
, and at most one null element. Key
values).@SuppressWarnings("unusable-by-js")
because J2CL transpiler emits warnings as not usable in the javascript part but
this collection must not be passed to any javascript code.Constructor and Description |
---|
ArrayKeySet(KeyFactory<E> factory)
Creates an empty set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Adds the specified element to this set if it is not already present (optional operation).
|
boolean |
addAll(Collection<? extends E> c)
Appends all of the elements in the specified collection to the end of this set, in the order that they are returned by the specified collection's iterator
|
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(Object object)
Returns true if this set contains the specified element.
|
boolean |
containsAll(Collection<?> c)
Returns true if this set contains all of the elements of the specified collection.
|
boolean |
isEmpty()
Returns true if this set contains no elements
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(Object o)
Removes the first occurrence of the specified element from this set, if it is present.
|
boolean |
removeAll(Collection<?> c)
Removes from this set all of its elements that are contained in the specified collection.
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this set that are contained in the specified collection.
In other words, removes from this set all of its elements that are not contained in the specified collection. |
int |
size()
Returns the number of elements in this set.
|
Object[] |
toArray()
Returns an array containing all of the elements in this set.
|
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
public ArrayKeySet(KeyFactory<E> factory)
factory
- factory instance to create the key from a native one.public boolean add(E e)
public final int size()
size
in interface Collection<E>
size
in interface Set<E>
public final boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
public final boolean contains(Object object)
contains
in interface Collection<E>
contains
in interface Set<E>
public final Iterator<E> iterator()
public final Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface Set<E>
public final <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in interface Set<E>
public final boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
public final boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public final boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface Set<E>
public final boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
public final boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
public final void clear()
clear
in interface Collection<E>
clear
in interface Set<E>