Class ScriptStats.ScriptCounter

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

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

    Modifier and Type
    Method
    Description
    void
    inc(org.microproxy.thirdparty.starlark.eval.StarlarkInt n)
    counter.inc(n=1).
    void
    repr(org.microproxy.thirdparty.starlark.eval.Printer printer, org.microproxy.thirdparty.starlark.eval.StarlarkSemantics semantics)
    Prints an official representation of object x.
    org.microproxy.thirdparty.starlark.eval.StarlarkInt
    counter.value.

    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

    • inc

      public void inc(org.microproxy.thirdparty.starlark.eval.StarlarkInt n) throws org.microproxy.thirdparty.starlark.eval.EvalException
      counter.inc(n=1).
      Parameters:
      n - how much to add
      Throws:
      org.microproxy.thirdparty.starlark.eval.EvalException - if n is negative or too large
    • value

      public org.microproxy.thirdparty.starlark.eval.StarlarkInt value()
      counter.value.
      Returns:
      the count so far
    • 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