public class PyChartScope
extends org.python.core.PyDictionary
Modifier and Type | Class and Description |
---|---|
static interface |
PyChartScope.ScopeObserver
An observer that gets notified when the scope is modified.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<PyChartScope.ScopeObserver> |
observers |
Modifier | Constructor and Description |
---|---|
|
PyChartScope() |
protected |
PyChartScope(java.util.Map<org.python.core.PyObject,org.python.core.PyObject> map) |
Modifier and Type | Method and Description |
---|---|
org.python.core.PyObject |
__findattr_ex__(java.lang.String name) |
void |
__set__(org.python.core.PyObject obj,
org.python.core.PyObject value) |
void |
__setattr__(java.lang.String name,
org.python.core.PyObject value) |
void |
__setitem__(org.python.core.PyObject key,
org.python.core.PyObject value) |
void |
addScopeObserver(PyChartScope.ScopeObserver observer) |
org.python.core.PyDictionary |
copy() |
protected static PyChartScope |
createFrom(org.python.core.PyDictionary dict)
This goes deep through a dictionary and creates PyChartScopes for any embedded dictionaries.*
|
org.python.core.PyDictionary |
createSerializableVersion() |
JSONObject |
createSnapshot() |
java.util.HashMap<java.lang.Object,java.lang.Object> |
getSerializableMap() |
PyChartScope |
getSubScope(java.lang.String id)
A convenience function for obtaining sub scopes.
|
boolean |
hasKey(java.lang.Object key) |
void |
insert(JSONObject json)
Takes a JSON object and inserts it into this scope, creating deep observable scopes for all sub dictionaries.
|
protected void |
notifyObservers(org.python.core.PyObject key,
org.python.core.PyObject value) |
protected void |
notifyObservers(java.lang.String key,
org.python.core.PyObject value) |
void |
removeScopeObserver(PyChartScope.ScopeObserver observer) |
void |
setVariable(java.lang.Object key,
java.lang.Object value)
Set or update a variable in the chart scope.
|
boolean |
supportsSubScopes()
If TRUE, keys of the nature "a.b.c" will be treated as sub scopes "a","b","c" under this one, and will be
obtained through getSubScope.
|
protected com.google.common.base.Optional<java.lang.Object> |
toJson(org.python.core.PyObject value) |
protected void |
transferObservers(PyChartScope newScope,
PyChartScope existing)
When we're replacing a scope, we need to notify everyone who is watching something in that scope.
|
__cmp__, __contains__, __delitem__, __eq__, __finditem__, __finditem__, __iter__, __len__, __ne__, __nonzero__, clear, containsKey, containsValue, dict___getitem__, dict___init__, entrySet, equals, fromkeys, fromkeys, get, get, get, getMap, has_key, hashCode, isEmpty, isMappingType, isSequenceType, items, iteritems, iterkeys, itervalues, keys, keySet, pop, pop, popitem, put, putAll, putIfAbsent, remove, remove, replace, replace, setdefault, setdefault, size, toString, update, values
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __complex__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __findattr__, __finditem__, __float__, __floordiv__, __ge__, __get__, __getattr__, __getattr__, __getitem__, __getitem__, __getnewargs__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __le__, __long__, __lshift__, __lt__, __mod__, __mul__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rawdir__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __setattr__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __unicode__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _unsupportedop, _xor, adaptToCoerceTuple, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, delDict, delType, dispatch__init__, fastGetClass, fastGetDict, getDict, getJavaProxy, getType, impAttr, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isNumberType, mergeClassDict, mergeDictAttr, mergeListAttr, noAttributeError, readonlyAttributeError, runsupportedopMessage, setDict, setType, unsupportedopMessage
protected final transient java.util.List<PyChartScope.ScopeObserver> observers
public PyChartScope()
protected PyChartScope(java.util.Map<org.python.core.PyObject,org.python.core.PyObject> map)
protected static PyChartScope createFrom(org.python.core.PyDictionary dict)
public org.python.core.PyDictionary copy()
copy
in class org.python.core.PyDictionary
public boolean supportsSubScopes()
public void addScopeObserver(PyChartScope.ScopeObserver observer)
public void removeScopeObserver(PyChartScope.ScopeObserver observer)
public PyChartScope getSubScope(java.lang.String id)
public boolean hasKey(java.lang.Object key)
public void setVariable(java.lang.Object key, java.lang.Object value)
__setitem__(PyObject, PyObject)
) must be used in order for observers to be notified.key
- entry key.value
- entry value.public void __setitem__(org.python.core.PyObject key, org.python.core.PyObject value)
__setitem__
in class org.python.core.PyDictionary
protected void transferObservers(PyChartScope newScope, PyChartScope existing)
public org.python.core.PyObject __findattr_ex__(java.lang.String name)
__findattr_ex__
in class org.python.core.PyObject
public void __setattr__(java.lang.String name, org.python.core.PyObject value)
__setattr__
in class org.python.core.PyObject
public void __set__(org.python.core.PyObject obj, org.python.core.PyObject value)
__set__
in class org.python.core.PyObject
protected void notifyObservers(org.python.core.PyObject key, org.python.core.PyObject value)
protected void notifyObservers(java.lang.String key, org.python.core.PyObject value)
public org.python.core.PyDictionary createSerializableVersion()
public JSONObject createSnapshot() throws java.lang.Exception
java.lang.Exception
protected com.google.common.base.Optional<java.lang.Object> toJson(org.python.core.PyObject value) throws java.lang.Exception
java.lang.Exception
public void insert(JSONObject json)
public java.util.HashMap<java.lang.Object,java.lang.Object> getSerializableMap()