org.python.core
public class PyStringMap extends PyObject
This is the default for all __dict__ instances.
Constructor Summary | |
---|---|
PyStringMap(int capacity) | |
PyStringMap() | |
PyStringMap(PyObject[] elements) |
Method Summary | |
---|---|
void | clear()
Remove all items from the dictionary. |
PyStringMap | copy()
Return a shallow copy of the dictionary. |
PyObject | get(PyObject key, PyObject default_object)
Return this[key] if the key exists in the mapping, default_object
is returned otherwise.
|
PyObject | get(PyObject key)
Return this[key] if the key exists in the mapping, None
is returned otherwise.
|
boolean | has_key(PyObject key)
Return true if the key exist in the dictionary. |
PyList | items()
Return a copy of the mappings list of (key, value) tuple
pairs. |
PyObject | iteritems()
return an iterator over (key, value) pairs |
PyObject | iterkeys()
return an iterator over the keys |
PyObject | itervalues()
return an iterator over the values |
PyList | keys()
Return a copy of the mappings list of keys. |
PyObject | popitem()
Return a random (key, value) tuple pair and remove the pair
from the mapping. |
PyObject | setdefault(PyObject key)
Return this[key] if the key exist, otherwise insert key with
a None value and return None.
|
PyObject | setdefault(PyObject key, PyObject failobj)
Return this[key] if the key exist, otherwise insert key with
the value of failobj and return failobj
|
String | toString() |
void | update(PyStringMap map)
Insert all the key:value pairs from map into
this mapping. |
void | update(PyDictionary dict)
Insert all the key:value pairs from dict into
this mapping. |
PyList | values()
Return a copy of the mappings list of values. |
int | __cmp__(PyObject other) |
void | __delitem__(String key) |
void | __delitem__(PyObject key) |
PyObject | __finditem__(String key) |
PyObject | __finditem__(PyObject key) |
PyObject | __iter__() |
int | __len__() |
boolean | __nonzero__() |
void | __setitem__(String key, PyObject value) |
void | __setitem__(PyObject key, PyObject value) |
Parameters: key the key to lookup in the mapping. default_object the value to return if the key does not exists in the mapping.
Parameters: key the key to lookup in the mapping.
Parameters: key the key to lookup in the mapping.
Parameters: key the key to lookup in the mapping. failobj the default value to insert in the mapping if key does not already exist.
map
into
this mapping.dict
into
this mapping.