public static class TopoUtils.ValueLabel
extends java.lang.Object
Constructor and Description |
---|
ValueLabel(long value,
java.lang.String unit)
Creates a value label with the given base value and unit.
|
Modifier and Type | Method and Description |
---|---|
TopoUtils.ValueLabel |
clipG(double threshold)
Clips the (adjusted) value to the given threshold expressed in
Giga units.
|
boolean |
clipped()
Returns true if this value was clipped to a maximum threshold.
|
TopoUtils.Magnitude |
magnitude()
Returns the magnitude value.
|
TopoUtils.ValueLabel |
perSec()
Mark this value to be expressed as a rate.
|
java.lang.String |
toString() |
public ValueLabel(long value, java.lang.String unit)
ValueLabel bits = new ValueLabel(2_050, "b"); ValueLabel bytesPs = new ValueLabel(3_000_000, "B").perSec();Generating labels:
bits.toString() ... "2.00 Kb" bytesPs.toString() ... "2.86 MBps"
value
- the base valueunit
- the value unitpublic TopoUtils.ValueLabel perSec()
public TopoUtils.ValueLabel clipG(double threshold)
ValueLabel tooMuch = new ValueLabel(12_000_000_000, "b") .perSec().clipG(10.0); tooMuch.toString() ... "10.00 Gbps" tooMuch.clipped() ... true
threshold
- the clip threshold (Giga)public boolean clipped()
public TopoUtils.Magnitude magnitude()
public java.lang.String toString()
toString
in class java.lang.Object