V - the value type@JsType(isNative=true,
name="Set",
namespace="<global>")
public class JsSet<V>
extends Object
JsCollections.set() to create an appropriate instance.| Constructor and Description |
|---|
JsSet()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
JsSet<V> |
add(V value)
Adds a value to this set, overwriting any previous value if present.
|
void |
clear()
Removes all values from this set.
|
boolean |
delete(V value)
Removes the given value from the set.
|
void |
forEach(JsCollections.ForEachCallback<V> callback)
Invokes the provided callback for each value in this set.
|
boolean |
has(V value)
Checks whether this set contains the given value.
|
boolean |
isEmpty()
Checks if the set is empty (size == 0).
|
int |
size()
Gets the number of values in this set.
|
public JsSet<V> add(V value)
value - the value to addpublic boolean has(V value)
value - the value to check fortrue if the value is in the set; false otherwisepublic boolean delete(V value)
value - the value to removetrue if the map contained the value prior to calling this
method; false otherwisepublic void clear()
public void forEach(JsCollections.ForEachCallback<V> callback)
callback - the callback to invoke for each value@JsProperty(name="size") public int size()
@JsOverlay public final boolean isEmpty()
true if the set is empty, false otherwiseCopyright © 2000–2021 Vaadin Ltd. All rights reserved.