Interface MutableJythonMap
-
- All Known Implementing Classes:
AbstractMutableJythonMap
public interface MutableJythonMap
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
__delitem__(org.python.core.PyObject pyKey)
RemovepyKey
from the map.void
__setitem__(org.python.core.PyObject pyKey, org.python.core.PyObject pyValue)
Update the map atpyKey
with new valuepyValue
void
clear()
Set every value in this mapping to null.org.python.core.PyObject
pop(org.python.core.PyObject pyKey)
Returns the value specified bypyKey
in the mapping, and deletes that entry.org.python.core.PyObject
pop(org.python.core.PyObject pyKey, org.python.core.PyObject def)
Returns the value specified bypyKey
in the mapping, and deletes that entry.org.python.core.PyObject
popitem()
Returns an arbitrary (not guaranteed random, nor guaranteed last) item (PyTuple key: value pair) from the dictionary, and removes that item from the mapping.org.python.core.PyObject
setdefault(org.python.core.PyObject pyKey)
Returns the value ofpyKey
if it is already present in the map.org.python.core.PyObject
setdefault(org.python.core.PyObject pyKey, org.python.core.PyObject def)
Returns the value ofpyKey
if it is already present in the map.void
update(org.python.core.PyObject[] args, java.lang.String[] keywords)
Updates this mapping, one of three possible ways: with a set of keyword arguments; eg{"a": 1}.update(b=2, c=3) == {"a": 1, "b": 2, * "c": 3}
with another dictionary directly with an iterable sequence of key:value pairs
-
-
-
Method Detail
-
clear
void clear()
Set every value in this mapping to null.
-
pop
org.python.core.PyObject pop(org.python.core.PyObject pyKey) throws org.python.core.PyException
Returns the value specified bypyKey
in the mapping, and deletes that entry.- Throws:
org.python.core.PyException
-Py.KeyError
if the pyKey is not present in the map.
-
pop
org.python.core.PyObject pop(org.python.core.PyObject pyKey, org.python.core.PyObject def)
Returns the value specified bypyKey
in the mapping, and deletes that entry. If the entry is not present, returnsdef
.
-
popitem
org.python.core.PyObject popitem() throws org.python.core.PyException, org.python.core.PyIgnoreMethodTag
Returns an arbitrary (not guaranteed random, nor guaranteed last) item (PyTuple key: value pair) from the dictionary, and removes that item from the mapping.- Throws:
org.python.core.PyException
org.python.core.PyIgnoreMethodTag
-
setdefault
org.python.core.PyObject setdefault(org.python.core.PyObject pyKey)
Returns the value ofpyKey
if it is already present in the map. If it is not, the value is added to the map with a default value ofPy.None
, and returns the value added to the map.
-
setdefault
org.python.core.PyObject setdefault(org.python.core.PyObject pyKey, org.python.core.PyObject def)
Returns the value ofpyKey
if it is already present in the map. If it is not, the value is added to the map withdef
, and returns the value added to the map.
-
update
void update(org.python.core.PyObject[] args, java.lang.String[] keywords)
Updates this mapping, one of three possible ways:- with a set of keyword arguments; eg
{"a": 1}.update(b=2, c=3) == {"a": 1, "b": 2, * "c": 3}
- with another dictionary directly
- with an iterable sequence of key:value pairs
- Parameters:
args
- arguments passed to this object. The second and third methods described above will pass a single PyObject in argskeywords
- 1:1 with arguments
- with a set of keyword arguments; eg
-
__setitem__
void __setitem__(org.python.core.PyObject pyKey, org.python.core.PyObject pyValue)
Update the map atpyKey
with new valuepyValue
-
__delitem__
void __delitem__(org.python.core.PyObject pyKey)
RemovepyKey
from the map.
-
-