Class ScriptStats.ScriptHistogram

java.lang.Object
org.microproxy.starlark.ScriptStats.ScriptHistogram
All Implemented Interfaces:
org.microproxy.thirdparty.starlark.eval.StarlarkValue
Enclosing class:
ScriptStats

public static final class ScriptStats.ScriptHistogram extends Object implements org.microproxy.thirdparty.starlark.eval.StarlarkValue
A histogram of a script.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.microproxy.thirdparty.starlark.eval.StarlarkInt
    histogram.count.
    void
    record(Object value)
    histogram.record(value).
    void
    repr(org.microproxy.thirdparty.starlark.eval.Printer printer, org.microproxy.thirdparty.starlark.eval.StarlarkSemantics semantics)
    Prints an official representation of object x.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.microproxy.thirdparty.starlark.eval.StarlarkValue

    checkHashable, debugPrint, getStarlarkType, isAcyclic, isImmutable, str, truth
  • Method Details

    • record

      public void record(Object value) throws org.microproxy.thirdparty.starlark.eval.EvalException
      histogram.record(value).
      Parameters:
      value - an int or a float
      Throws:
      org.microproxy.thirdparty.starlark.eval.EvalException - if it is not a finite number
    • count

      public org.microproxy.thirdparty.starlark.eval.StarlarkInt count()
      histogram.count.
      Returns:
      how many values were recorded
    • repr

      public void repr(org.microproxy.thirdparty.starlark.eval.Printer printer, org.microproxy.thirdparty.starlark.eval.StarlarkSemantics semantics)
      Description copied from interface: org.microproxy.thirdparty.starlark.eval.StarlarkValue
      Prints an official representation of object x.

      Convention is that the string should be parseable back to the value x. If this isn't feasible then it should be a short human-readable description enclosed in angled brackets, e.g. "<foo object>".

      Specified by:
      repr in interface org.microproxy.thirdparty.starlark.eval.StarlarkValue
      Parameters:
      printer - a printer to be used for formatting nested values.
      semantics - the interpreter settings used to format nested values