Package jp.vmi.script
Class JSMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- jp.vmi.script.JSMap<K,V>
-
- Type Parameters:
K- the type of key.V- the type of value.
- All Implemented Interfaces:
Map<K,V>
public class JSMap<K,V> extends AbstractMap<K,V>
Wrapper for JavaScript map.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJSMap.EntrySetCallback<K,V>-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description JSMap(ScriptEngine engine, Object object)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Map.Entry<K,V>>entrySet()Vget(Object key)static <K,V>
Map<K,V>toMap(ScriptEngine engine, Object object)JavaScript object to Map.Objectunwrap()Unwrap object.-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
JSMap
public JSMap(ScriptEngine engine, Object object)
Constructor.- Parameters:
engine- script engine.object- JavaScript object.
-
-
Method Detail
-
unwrap
public Object unwrap()
Unwrap object.- Returns:
- unwrapped object.
-
toMap
public static <K,V> Map<K,V> toMap(ScriptEngine engine, Object object)
JavaScript object to Map.- Type Parameters:
K- the type of key.V- the type of value.- Parameters:
engine- Script engine.object- JavaScript object.- Returns:
- Map object.
-
-