Package org.nuiton.profiling
Class Unit
- java.lang.Object
-
- org.nuiton.profiling.Unit
-
public class Unit extends Object
Helper class to format number. We don't use existing format method in other library to minimise dependency. NuitonTrace can't work correctly if he has external dependncy.- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUnit.Memorystatic classUnit.Time
-
Constructor Summary
Constructors Constructor Description Unit()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringformat(double value, Unit.Memory source, int precision)Choice better target unit for this value. source unit must be small unit like octet or millis or nanosecond.static Stringformat(double value, Unit.Memory source, Unit.Memory target, int precision)static Stringformat(double value, Unit.Time source, int precision)Choice better target unit for this value. source unit must be small unit like octet or millis or nanosecond.static Stringformat(double value, Unit.Time source, Unit.Time target, int precision)
-
-
-
Method Detail
-
format
public static String format(double value, Unit.Memory source, Unit.Memory target, int precision)
-
format
public static String format(double value, Unit.Time source, Unit.Time target, int precision)
-
format
public static String format(double value, Unit.Memory source, int precision)
Choice better target unit for this value. source unit must be small unit like octet or millis or nanosecond.- Parameters:
value-source-precision-- Returns:
-
-