Class PeriodFormat
- java.lang.Object
-
- org.epics.archiverappliance.engine.model.PeriodFormat
-
public class PeriodFormat extends Object
Parser for scan or update periods- Author:
- Kay Kasemir
-
-
Constructor Summary
Constructors Constructor Description PeriodFormat()
-
Method Summary
Modifier and Type Method Description static String
formatSeconds(double seconds)
Format seconds as string, using hours or minutes if appropriate.static double
parseSeconds(String text)
Parse seconds from text.
-
-
-
Method Detail
-
parseSeconds
public static double parseSeconds(String text)
Parse seconds from text.Text must contain a (double) number, optionally followed by units "days", "hours", "minutes", "seconds". Only "m", "min", ... is interpreted as "minutes" as well. In the absense of units, it defaults to seconds.
- Parameters:
text
- Text to parse- Returns:
- seconds
-
formatSeconds
public static String formatSeconds(double seconds)
Format seconds as string, using hours or minutes if appropriate.- Parameters:
seconds
- Seconds to format- Returns:
- A string that
parseSeconds()
can handle.
-
-