Interface JythonMap
-
- All Known Implementing Classes:
AbstractJythonMap,AbstractMutableJythonMap,DotReferenceJythonMap,PropertyTreeScriptWrapper,PropertyTreeScriptWrapper.ObjectWrapper,PyJsonObjectAdapter
public interface JythonMap
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean__contains__(org.python.core.PyObject pyKey)org.python.core.PyObject__finditem__(int key)Look up and return the specified key.org.python.core.PyObject__finditem__(java.lang.String key)Look up and return the specified key.org.python.core.PyObject__finditem__(org.python.core.PyObject pyKey)Look up and return the specified key.org.python.core.PyObject__iter__()Returns an iterator over this mapping.int__len__()org.python.core.PyObjectget(org.python.core.PyObject pyKey)Get the value for the specified key, orPyNoneif there was no result.org.python.core.PyObjectget(org.python.core.PyObject pyKey, org.python.core.PyObject def)Get the value for the specified key, ordefaultif the key was not present.booleanhas_key(org.python.core.PyObject pyKey)org.python.core.PyListitems()org.python.core.PyObjectiteritems()org.python.core.PyObjectiterkeys()org.python.core.PyObjectitervalues()org.python.core.PyListkeys()java.lang.StringtoString()org.python.core.PyListvalues()
-
-
-
Method Detail
-
keys
org.python.core.PyList keys()
- Returns:
- A list of keys
-
iterkeys
org.python.core.PyObject iterkeys()
- Returns:
- an Iterable of keys; see
Java2PyIterator
-
values
org.python.core.PyList values()
- Returns:
- a list of values
-
itervalues
org.python.core.PyObject itervalues()
- Returns:
- an Iterable of values; see
Java2PyIterator
-
items
org.python.core.PyList items()
- Returns:
- a list of items; should be a PyTuple consisting of key: value pairs
-
iteritems
org.python.core.PyObject iteritems()
- Returns:
- an Iterable of items; see
Java2PyIterator
-
has_key
boolean has_key(org.python.core.PyObject pyKey)
- Returns:
trueif the underlying map has the requisite key. Usage is generally discouraged - the Pythonic approach is to usekey in mapping.
-
get
org.python.core.PyObject get(org.python.core.PyObject pyKey)
Get the value for the specified key, orPyNoneif there was no result. Should not throw an exception.- Parameters:
pyKey- The key, which may be a string (PyObject.asString()or a numeric index (PyObject.asInt()
-
get
org.python.core.PyObject get(org.python.core.PyObject pyKey, org.python.core.PyObject def)Get the value for the specified key, ordefaultif the key was not present.- Parameters:
pyKey- The pyKey, which may be a string (PyObject.asString()or a numeric index (PyObject.asInt()
-
__iter__
org.python.core.PyObject __iter__()
Returns an iterator over this mapping. For 'dictionary' like classes, should just be the keys.
-
__contains__
boolean __contains__(org.python.core.PyObject pyKey)
- Returns:
trueif the underlying map has the requisite key
-
__len__
int __len__()
- Returns:
- the length of this mapping.
-
__finditem__
org.python.core.PyObject __finditem__(java.lang.String key) throws org.python.core.PyExceptionLook up and return the specified key.- Throws:
org.python.core.PyException
-
__finditem__
org.python.core.PyObject __finditem__(org.python.core.PyObject pyKey) throws org.python.core.PyExceptionLook up and return the specified key.- Throws:
org.python.core.PyException
-
__finditem__
org.python.core.PyObject __finditem__(int key) throws org.python.core.PyExceptionLook up and return the specified key.- Throws:
org.python.core.PyException
-
toString
java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a string containing a printable representation of this object. If practical, should match the evaluation
format of a Python dictionary -
{"key": 123, "key_2": "value"}
-
-