Class JsCollections
- java.lang.Object
-
- com.vaadin.client.flow.collection.JsCollections
-
public class JsCollections extends Object
Factory for JavaScript collection implementations with support for alternative JRE implementations.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJsCollections.ForEachCallback<V>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> JsArray<T>array()Creates a new JavaScript Array.static <T> JsArray<T>array(T... values)Creates a new JavaScript Array with the given contents.static <K,V>
JsMap<K,V>map()Creates a new JavaScript Map.static <V> JsSet<V>set()Creates a new empty JavaScript Set.static <T> JsSet<T>set(JsSet<T> values)Creates a new JavaScript Set with the same contents as another set.static <K,V>
JsWeakMap<K,V>weakMap()Creates a new JavaScript WeakMap.
-
-
-
Method Detail
-
array
public static <T> JsArray<T> array()
Creates a new JavaScript Array.- Type Parameters:
T- the array type- Returns:
- a new JS array instance
-
array
@SafeVarargs public static <T> JsArray<T> array(T... values)
Creates a new JavaScript Array with the given contents.- Type Parameters:
T- the array type- Parameters:
values- the values of the new array- Returns:
- a new JS array instance
-
map
public static <K,V> JsMap<K,V> map()
Creates a new JavaScript Map.- Type Parameters:
K- the key typeV- the value type- Returns:
- a new JS map instance
-
weakMap
public static <K,V> JsWeakMap<K,V> weakMap()
Creates a new JavaScript WeakMap.- Type Parameters:
K- the key typeV- the value type- Returns:
- a new JS weak map instance
-
set
public static <V> JsSet<V> set()
Creates a new empty JavaScript Set.- Type Parameters:
V- the set type- Returns:
- a new empty JS Set instance
-
-