Class EmptyQueryScope

java.lang.Object
io.deephaven.engine.context.EmptyQueryScope
All Implemented Interfaces:
LogOutputAppendable, QueryScope, LivenessManager, LivenessNode, LivenessReferent

public class EmptyQueryScope extends Object implements QueryScope
  • Field Details

  • Method Details

    • getParamNames

      public Set<String> getParamNames()
      Description copied from interface: QueryScope
      Get all known scope variable names.
      Specified by:
      getParamNames in interface QueryScope
      Returns:
      A caller-owned mutable collection of scope variable names.
    • hasParamName

      public boolean hasParamName(String name)
      Description copied from interface: QueryScope
      Check if the scope has the given name.
      Specified by:
      hasParamName in interface QueryScope
      Parameters:
      name - param name
      Returns:
      True iff the scope has the given param name
    • createParam

      public <T> QueryScopeParam<T> createParam(String name) throws QueryScope.MissingVariableException
      Description copied from interface: QueryScope
      Get a QueryScopeParam by name.
      Specified by:
      createParam in interface QueryScope
      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

      public <T> T readParamValue(String name) throws QueryScope.MissingVariableException
      Description copied from interface: QueryScope
      Get the value of a given scope parameter by name. Callers may want to unwrap language-specific values using QueryScope.unwrapObject(Object) before using them.
      Specified by:
      readParamValue in interface QueryScope
      Parameters:
      name - parameter name.
      Returns:
      parameter value.
      Throws:
      QueryScope.MissingVariableException - If no such scope parameter exists.
    • readParamValue

      public <T> T readParamValue(String name, T defaultValue)
      Description copied from interface: QueryScope
      Get the value of a given scope parameter by name. Callers may want to unwrap language-specific values using QueryScope.unwrapObject(Object) before using them.
      Specified by:
      readParamValue in interface QueryScope
      Parameters:
      name - parameter name.
      defaultValue - default parameter value.
      Returns:
      parameter value, or the default parameter value, if the value is not present.
    • putParam

      public <T> void putParam(String name, T value)
      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 interface QueryScope
      Parameters:
      name - parameter name.
      value - parameter value.
    • toMap

      public Map<String,Object> toMap(@NotNull @NotNull QueryScope.ParamFilter<Object> filter)
      Description copied from interface: QueryScope
      Returns a mutable map with all objects in the scope. Callers may want to unwrap language-specific values using QueryScope.unwrapObject(Object) before using them. This returned map is owned by the caller.
      Specified by:
      toMap in interface QueryScope
      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 interface QueryScope
      Type Parameters:
      T - the type of the mapped values
      Parameters:
      valueMapper - a function to map the values
      filter - a predicate to filter the map entries
      Returns:
      a caller-owned mutable map with all known variables and their values.
    • tryManage

      public boolean tryManage(@NotNull @NotNull LivenessReferent referent)
      Description copied from interface: LivenessManager
      Attempt to add referent to this manager. Will succeed if referent is live and if this manager is not a LivenessReferent or is live.
      Specified by:
      tryManage in interface LivenessManager
      Parameters:
      referent - The referent to add
      Returns:
      Whether the referent was in fact added
    • tryUnmanage

      public boolean tryUnmanage(@NotNull @NotNull LivenessReferent referent)
      Description copied from interface: LivenessManager
      If this manager manages referent one or more times, drop one such reference. If this manager is also a LivenessReferent, then this method is a no-op if this is not live.
      Specified by:
      tryUnmanage in interface LivenessManager
      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 returns true if dropping a reference via this method is supported by the implementation.
    • tryUnmanage

      public boolean tryUnmanage(@NotNull @NotNull Stream<? extends LivenessReferent> referents)
      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 a LivenessReferent, then this method is a no-op if this is not live.
      Specified by:
      tryUnmanage in interface LivenessManager
      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 returns true 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 as LivenessReferent.retainReference() and return true. Otherwise, returns false rather than throwing an exception.
      Specified by:
      tryRetainReference in interface LivenessReferent
      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 interface LivenessReferent
    • getWeakReference

      public WeakReference<? extends LivenessReferent> getWeakReference()
      Description copied from interface: LivenessReferent
      Get a WeakReference to this referent. This may be cached, or newly created.
      Specified by:
      getWeakReference in interface LivenessReferent
      Returns:
      A new or cached reference to this referent