Package io.deephaven.engine.context
Class EmptyQueryScope
java.lang.Object
io.deephaven.engine.context.EmptyQueryScope
- All Implemented Interfaces:
LogOutputAppendable
,QueryScope
,LivenessManager
,LivenessNode
,LivenessReferent
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.context.QueryScope
QueryScope.MissingVariableException, QueryScope.ParamFilter<T>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T> QueryScopeParam<T>
createParam
(String name) Get a QueryScopeParam by name.void
Drop a previously-retained reference to this referent.Get all known scope variable names.WeakReference<? extends LivenessReferent>
Get aWeakReference
to this referent.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.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.boolean
tryManage
(@NotNull LivenessReferent referent) Attempt to addreferent
to this manager.boolean
If this referent is "live", behave asLivenessReferent.retainReference()
and return true.boolean
tryUnmanage
(@NotNull LivenessReferent referent) If this manager manages referent one or more times, drop one such reference.boolean
tryUnmanage
(@NotNull Stream<? extends LivenessReferent> referents) For each referent in referents, if this manager manages referent one or more times, drop one such reference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
Methods inherited from interface io.deephaven.engine.context.QueryScope
append, getParams, unwrapObject
-
Field Details
-
INSTANCE
-
-
Method Details
-
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.
-
tryManage
Description copied from interface:LivenessManager
Attempt to addreferent
to this manager. Will succeed ifreferent
is live and if this manager is not aLivenessReferent
or is live.- Specified by:
tryManage
in interfaceLivenessManager
- Parameters:
referent
- The referent to add- Returns:
- Whether the referent was in fact added
-
tryUnmanage
Description copied from interface:LivenessManager
If this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent
, then this method is a no-op ifthis
is not live.- Specified by:
tryUnmanage
in interfaceLivenessManager
- Parameters:
referent
- The referent to drop- Returns:
- If this node is also a
LivenessReferent
, whether this node was live and thus in fact tried to drop a reference. Else always returnstrue
if dropping a reference via this method is supported by the implementation.
-
tryUnmanage
Description copied from interface:LivenessManager
For each referent in referents, if this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent
, then this method is a no-op ifthis
is not live.- Specified by:
tryUnmanage
in interfaceLivenessManager
- Parameters:
referents
- The referents to drop- Returns:
- If this node is also a
LivenessReferent
, whether this node was live and thus in fact tried to drop the references. Else always returnstrue
if dropping a reference via this method is supported by the implementation.
-
tryRetainReference
public boolean tryRetainReference()Description copied from interface:LivenessReferent
If this referent is "live", behave asLivenessReferent.retainReference()
and return true. Otherwise, returns false rather than throwing an exception.- Specified by:
tryRetainReference
in interfaceLivenessReferent
- Returns:
- True if this referent was retained, false otherwise
-
dropReference
public void dropReference()Description copied from interface:LivenessReferent
Drop a previously-retained reference to this referent.- Specified by:
dropReference
in interfaceLivenessReferent
-
getWeakReference
Description copied from interface:LivenessReferent
Get aWeakReference
to this referent. This may be cached, or newly created.- Specified by:
getWeakReference
in interfaceLivenessReferent
- Returns:
- A new or cached reference to this referent
-