public class JSObjectPropertiesMap<V> extends JSObjectWrapper implements java.util.Map<java.lang.String,V>
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) |
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() |
getJSObject
__nullFunc, callAsFunction, callAsFunction, callAsFunction, callAsFunction, deleteProperty, getThis, hashCode, hasProperty, isConstructor, isFunction, property, property, property, propertyAtIndex, propertyAtIndex, propertyNames, prototype, prototype
equals, getContext, isArray, isBoolean, isDate, isEqual, isInstanceOfConstructor, isNull, isNumber, isObject, isStrictEqual, isString, isUndefined, toBoolean, toFunction, toJSArray, toJSON, toJSON, toNumber, toObject, toString, 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(java.lang.Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,V>
Map.containsValue(java.lang.Object)
public V get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,V>
Map.get(java.lang.Object)
public V put(java.lang.String key, V value)
put
in interface java.util.Map<java.lang.String,V>
Map.put(java.lang.Object, java.lang.Object)
public V remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,V>
Map.remove(java.lang.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(java.util.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()