Package io.deephaven.engine.util
Class AbstractScriptSession.ScriptSessionQueryScope
java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.liveness.LivenessScope
io.deephaven.engine.util.AbstractScriptSession.ScriptSessionQueryScope
- All Implemented Interfaces:
LogOutputAppendable
,QueryScope
,LivenessManager
,LivenessNode
,LivenessReferent
,ReleasableLivenessManager
- Enclosing class:
- AbstractScriptSession<S extends AbstractScriptSession.Snapshot>
public class AbstractScriptSession.ScriptSessionQueryScope
extends LivenessScope
implements QueryScope
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.context.QueryScope
QueryScope.MissingVariableException, QueryScope.ParamFilter<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> QueryScopeParam<T>
createParam
(String name) Get a QueryScopeParam by name.Get all known scope variable names.boolean
hasParamName
(String name) Check if the scope has the given name.<T> void
Add a parameter to the scope.<T> T
readParamValue
(String name) Get the value of a given scope parameter by name.<T> T
readParamValue
(String name, T defaultValue) Get the value of a given scope parameter by name.Internal workaround to support python calling pushScope.toMap
(@NotNull QueryScope.ParamFilter<Object> filter) Returns a mutable map with all objects in the scope.toMap
(@NotNull Function<Object, T> valueMapper, @NotNull QueryScope.ParamFilter<T> filter) Returns a mutable map with all objects in the scope.unwrapObject
(@Nullable Object object) Removes any wrapping that exists on a scope param object so that clients can fetch them.Methods inherited from class io.deephaven.engine.liveness.LivenessScope
release, transferTo
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanage
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReference
Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage
Methods inherited from interface io.deephaven.engine.liveness.LivenessNode
tryUnmanage, tryUnmanage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
Methods inherited from interface io.deephaven.engine.context.QueryScope
append, getParams
-
Constructor Details
-
ScriptSessionQueryScope
public ScriptSessionQueryScope()
-
-
Method Details
-
scriptSession
Internal workaround to support python calling pushScope. -
getParamNames
Description copied from interface:QueryScope
Get all known scope variable names.- Specified by:
getParamNames
in interfaceQueryScope
- Returns:
- A caller-owned mutable collection of scope variable names.
-
hasParamName
Description copied from interface:QueryScope
Check if the scope has the given name.- Specified by:
hasParamName
in interfaceQueryScope
- Parameters:
name
- param name- Returns:
- True iff the scope has the given param name
-
createParam
Description copied from interface:QueryScope
Get a QueryScopeParam by name.- Specified by:
createParam
in interfaceQueryScope
- Parameters:
name
- parameter name- Returns:
- newly-constructed QueryScopeParam (name + value-snapshot pair).
- Throws:
QueryScope.MissingVariableException
- If any of the named scope variables does not exist.
-
readParamValue
Description copied from interface:QueryScope
Get the value of a given scope parameter by name. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)
before using them.- Specified by:
readParamValue
in interfaceQueryScope
- Parameters:
name
- parameter name.- Returns:
- parameter value.
- Throws:
QueryScope.MissingVariableException
- If no such scope parameter exists.
-
readParamValue
Description copied from interface:QueryScope
Get the value of a given scope parameter by name. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)
before using them.- Specified by:
readParamValue
in interfaceQueryScope
- Parameters:
name
- parameter name.defaultValue
- default parameter value.- Returns:
- parameter value, or the default parameter value, if the value is not present.
-
putParam
Description copied from interface:QueryScope
Add a parameter to the scope. Objects passed in will have their liveness managed by the scope.- Specified by:
putParam
in interfaceQueryScope
- Parameters:
name
- parameter name.value
- parameter value.
-
toMap
Description copied from interface:QueryScope
Returns a mutable map with all objects in the scope. Callers may want to unwrap language-specific values usingQueryScope.unwrapObject(Object)
before using them. This returned map is owned by the caller.- Specified by:
toMap
in interfaceQueryScope
- Parameters:
filter
- a predicate to filter the map entries- Returns:
- a caller-owned mutable map with all known variables and their values.
-
toMap
public <T> Map<String,T> toMap(@NotNull @NotNull Function<Object, T> valueMapper, @NotNull @NotNull QueryScope.ParamFilter<T> filter) Description copied from interface:QueryScope
Returns a mutable map with all objects in the scope.Callers may want to pass in a valueMapper of
QueryScope.unwrapObject(Object)
which would unwrap values before filtering. The returned map is owned by the caller.- Specified by:
toMap
in interfaceQueryScope
- Type Parameters:
T
- the type of the mapped values- Parameters:
valueMapper
- a function to map the valuesfilter
- a predicate to filter the map entries- Returns:
- a caller-owned mutable map with all known variables and their values.
-
unwrapObject
Description copied from interface:QueryScope
Removes any wrapping that exists on a scope param object so that clients can fetch them. Defaults to returning the object itself.- Specified by:
unwrapObject
in interfaceQueryScope
- Parameters:
object
- the scoped object- Returns:
- an obj which can be consumed by a client
-