public class JSObjectPropertiesMap<V> extends JSObject implements java.util.Map<java.lang.String,V>
JSObject.jsexport, JSObject.Property<T>
JSPropertyAttributeDontDelete, JSPropertyAttributeDontEnum, JSPropertyAttributeNone, JSPropertyAttributeReadOnly
Constructor and Description |
---|
JSObjectPropertiesMap(JSContext context,
java.lang.Class<V> cls)
Creates a new Map object and underlying JSObject with no initial properties.
|
JSObjectPropertiesMap(JSContext context,
java.util.Map map,
java.lang.Class<V> cls)
Creates a new Map object and underlying JSObject and sets initial properties in 'map'.
|
JSObjectPropertiesMap(JSObject object,
java.lang.Class<V> cls)
Creates a new Map object which operates on object 'object' and assumes type 'cls'.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,V>> |
entrySet() |
V |
get(java.lang.Object key) |
JSObject |
getJSObject()
Gets underlying JSObject
|
boolean |
isEmpty() |
java.util.Set |
keySet() |
V |
put(java.lang.String key,
V value) |
void |
putAll(java.util.Map<? extends java.lang.String,? extends V> map) |
V |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<V> |
values() |
__nullFunc, deleteProperty, getThis, hashCode, hasProperty, isConstructor, isFunction, property, property, property, propertyAtIndex, propertyAtIndex, propertyNames, prototype, prototype
equals, getContext, isArray, isBoolean, isDate, isEqual, isFloat32Array, isFloat64Array, isInstanceOfConstructor, isInt16Array, isInt32Array, isInt8Array, isNull, isNumber, isObject, isStrictEqual, isString, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, toBoolean, toFunction, toJSArray, toJSON, toNumber, toObject, toString, valueHash, valueRef
public JSObjectPropertiesMap(JSObject object, java.lang.Class<V> cls)
java.util.Map<String,Double> map = new JSObjectPropertiesMap<String,Double>(object,Double.class);
object
- The JSObject whose properties will be mappedcls
- The class of the component Values; must match templatepublic JSObjectPropertiesMap(JSContext context, java.util.Map map, java.lang.Class<V> cls)
java.util.Map<String,Double> map = new HashMap<>();
map.put("one",1.0);
map.put("two",2.0);
java.util.Map<String,Double> jsmap = new JSObjectPropertiesMap<String,Double>(context,map,Double.class)
context
- The JSContext in which to create the objectmap
- The initial properties to setcls
- The class of the component Values; must match templatepublic JSObjectPropertiesMap(JSContext context, java.lang.Class<V> cls)
java.util.Map<String,Double> jsmap = new JSObjectPropertiesMap<String,Double>(context,Double.class)
context
- The JSContext in which to create the objectcls
- The class of the component Values; must match templatepublic int size()
size
in interface java.util.Map<java.lang.String,V>
Map.size()
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,V>
Map.isEmpty()
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,V>
Map.containsKey(Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,V>
Map.containsValue(Object)
public V get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,V>
Map.get(Object)
public V put(java.lang.String key, V value)
put
in interface java.util.Map<java.lang.String,V>
Map.put(Object, Object)
public V remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,V>
Map.remove(Object)
public void putAll(@NonNull java.util.Map<? extends java.lang.String,? extends V> map)
putAll
in interface java.util.Map<java.lang.String,V>
Map.putAll(Map)
public void clear()
clear
in interface java.util.Map<java.lang.String,V>
Map.clear()
@NonNull public java.util.Set keySet()
keySet
in interface java.util.Map<java.lang.String,V>
Map.keySet()
@NonNull public java.util.Collection<V> values()
values
in interface java.util.Map<java.lang.String,V>
Map.values()
@NonNull public java.util.Set<java.util.Map.Entry<java.lang.String,V>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,V>
Map.entrySet()
public JSObject getJSObject()