Modifier and Type | Method and Description |
---|---|
static ProxyHashMap |
from(Map<Object,Object> values)
Creates a proxy hash map backed by a Java
Map . |
Object |
getHashEntriesIterator()
Returns the hash entries iterator.
|
long |
getHashSize()
Returns the number of map entries.
|
Object |
getHashValue(Value key)
Returns the value for the specified key.
|
boolean |
hasHashEntry(Value key)
Returns
true if the proxy object contains a mapping for the specified key, or else
false . |
void |
putHashEntry(Value key,
Value value)
Associates the specified value with the specified key.
|
default boolean |
removeHashEntry(Value key)
Removes the mapping for a given key.
|
long getHashSize()
boolean hasHashEntry(Value key)
true
if the proxy object contains a mapping for the specified key, or else
false
. Every key which returns true
for ProxyHashMap.hasHashEntry(Value)
must be
included in the iterator
returned by
ProxyHashMap.getHashEntriesIterator()
to allow guest language to enumerate map entries.ProxyHashMap.getHashEntriesIterator()
Object getHashValue(Value key)
UnsupportedOperationException
- if the operation is unsupportedvoid putHashEntry(Value key, Value value)
exist
then a new mapping is defined otherwise, an
existing mapping is updated.UnsupportedOperationException
- if the operation is unsupporteddefault boolean removeHashEntry(Value key)
UnsupportedOperationException
is thrown.true
when the mapping was removed, false
when the mapping didn't
exist.UnsupportedOperationException
- if the operation is unsupportedObject getHashEntriesIterator()
Context.asValue(Object)
otherwise an
IllegalStateException
is thrown. The iterator elements must be interpreted as two
elements array using the semantics of Context.asValue(Object)
.
Examples for valid return values are:
ProxyIterator
Iterator
, requires host iterable
access
Examples for valid iterator elements are:
ProxyArray
List
, requires host list access
Object[2]
, requires host array access
Map.Entry
, requires host map access
ProxyIterator
static ProxyHashMap from(Map<Object,Object> values)
Map
. The map keys are
as Object unboxed
. If the set values are host values then they will
be unboxed
.