Class PeriodFormat
java.lang.Object
org.epics.archiverappliance.engine.model.PeriodFormat
Parser for scan or update periods
- Author:
- Kay Kasemir
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatSeconds(double seconds) Format seconds as string, using hours or minutes if appropriate.static doubleparseSeconds(String text) Parse seconds from text.
-
Constructor Details
-
PeriodFormat
public PeriodFormat()
-
-
Method Details
-
parseSeconds
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
Format seconds as string, using hours or minutes if appropriate.- Parameters:
seconds- Seconds to format- Returns:
- A string that
parseSeconds()can handle.
-