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
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> QueryScopeParam<T>createParam(String name) Get a QueryScopeParam by name.Get all known scope variable names.booleanhasParamName(String name) Check if the scope has the given name.<T> voidAdd a parameter to the scope.<T> TreadParamValue(String name) Get the value of a given scope parameter by name.<T> TreadParamValue(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, transferToMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
destroy, dropReference, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage, tryUnmanage, tryUnmanage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods 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:QueryScopeGet all known scope variable names.- Specified by:
getParamNamesin interfaceQueryScope- Returns:
- A caller-owned mutable collection of scope variable names.
-
hasParamName
Description copied from interface:QueryScopeCheck if the scope has the given name.- Specified by:
hasParamNamein interfaceQueryScope- Parameters:
name- param name- Returns:
- True iff the scope has the given param name
-
createParam
Description copied from interface:QueryScopeGet a QueryScopeParam by name.- Specified by:
createParamin 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:QueryScopeGet 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:
readParamValuein interfaceQueryScope- Parameters:
name- parameter name.- Returns:
- parameter value.
- Throws:
QueryScope.MissingVariableException- If no such scope parameter exists.
-
readParamValue
Description copied from interface:QueryScopeGet 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:
readParamValuein 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:QueryScopeAdd a parameter to the scope. Objects passed in will have their liveness managed by the scope.- Specified by:
putParamin interfaceQueryScope- Parameters:
name- parameter name.value- parameter value.
-
toMap
Description copied from interface:QueryScopeReturns 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:
toMapin 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:QueryScopeReturns 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:
toMapin 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:QueryScopeRemoves any wrapping that exists on a scope param object so that clients can fetch them. Defaults to returning the object itself.- Specified by:
unwrapObjectin interfaceQueryScope- Parameters:
object- the scoped object- Returns:
- an obj which can be consumed by a client
-