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.PyObject get​(org.python.core.PyObject pyKey)
      Get the value for the specified key, or PyNone if there was no result.
      org.python.core.PyObject get​(org.python.core.PyObject pyKey, org.python.core.PyObject def)
      Get the value for the specified key, or default if the key was not present.
      boolean has_key​(org.python.core.PyObject pyKey)  
      org.python.core.PyList items()  
      org.python.core.PyObject iteritems()  
      org.python.core.PyObject iterkeys()  
      org.python.core.PyObject itervalues()  
      org.python.core.PyList keys()  
      java.lang.String toString()  
      org.python.core.PyList values()  
    • 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:
        true if the underlying map has the requisite key. Usage is generally discouraged - the Pythonic approach is to use key in mapping.
      • get

        org.python.core.PyObject get​(org.python.core.PyObject pyKey)
        Get the value for the specified key, or PyNone if 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, or default if 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:
        true if 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.PyException
        Look 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.PyException
        Look up and return the specified key.
        Throws:
        org.python.core.PyException
      • __finditem__

        org.python.core.PyObject __finditem__​(int key)
                                       throws org.python.core.PyException
        Look up and return the specified key.
        Throws:
        org.python.core.PyException
      • toString

        java.lang.String toString()
        Overrides:
        toString in class java.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"}