- java.lang.Object
-
- javafx.util.StringConverter<Number>
-
- eu.ess.xaos.ui.plot.TimeAxis.TimeConverter
-
- Enclosing class:
- TimeAxis
public static class TimeAxis.TimeConverter extends StringConverter<Number>
ConvertsNumber
s to/from "[-][H…HH:][MM:]SS[.sss]" strings. Hours grater than 23 will never be converted in days, instead they can be clamped to 0..23 or not.
-
-
Constructor Summary
Constructors Constructor Description TimeConverter()
TimeConverter(TimeUnit minTimeUnit, TimeUnit maxTimeUnit)
-
-
-
Constructor Detail
-
TimeConverter
public TimeConverter()
-
TimeConverter
public TimeConverter(TimeUnit minTimeUnit, TimeUnit maxTimeUnit) throws IllegalArgumentException, NullPointerException
Creates a new time converted with the specified minimum and maximum time units used to convert fromNumber
toString
.- Parameters:
minTimeUnit
- FromTimeUnit.MILLISECONDS
up toTimeUnit.SECONDS
, clamped otherwise.maxTimeUnit
- FromTimeUnit.DAYS
down toTimeUnit.SECONDS
, clamped otherwise. IfTimeUnit.HOURS
, the hours will be clamped to 0..23, otherwise ifTimeUnit.DAYS
the total amount of hours will be used.- Throws:
IllegalArgumentException
- IfminTimeUnit > maxTimeUnit
.NullPointerException
- If one or both parameters arenull
.
-
-
Method Detail
-
fromString
public Number fromString(String value)
- Specified by:
fromString
in classStringConverter<Number>
-
toString
public String toString(Number value)
- Specified by:
toString
in classStringConverter<Number>
-
-