Package org.microproxy.starlark
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 TypeMethodDescriptionvoidinc(org.microproxy.thirdparty.starlark.eval.StarlarkInt n) counter.inc(n=1).voidrepr(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.StarlarkIntvalue()counter.value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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- ifnis 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.StarlarkValuePrints 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:
reprin interfaceorg.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
-