public class Duration_calendaric extends Object implements Comparable<Duration_calendaric>, DurationIndication
Modifier and Type | Field and Description |
---|---|
protected int |
hours
Complete hours covered by ths duration.
|
protected boolean |
isSplit
Whether normalization has been done.
|
protected int |
minutes
Complete minutes this duration is longer than
hours . |
static BigDecimal |
minutes_per_hour
Evident
|
static BigDecimal |
seconds_per_minute
Evident
|
protected BigDecimal |
secondsOnly
|
protected BigDecimal |
value
The value of this duration, in seconds.
|
Constructor and Description |
---|
Duration_calendaric(BigDecimal s)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Duration_calendaric d)
Evident
|
static Duration_calendaric |
fromRational()
This conversion fails since no translation relation is per default.
|
int |
get_hours()
Return the maximum number of hours which is equal or less than the duration.
|
int |
get_minutes()
Return the number of minutes the duration is longer than the integral
hours delivered by
get_hours() . |
BigDecimal |
get_secondsOnly()
Return the number of seconds the duration is longer than the maximum
number of integral minutes (=
get_hours() * 60 + get_minutes() . |
BigDecimal |
get_valueInSeconds()
Return the duration value measured in seconds and fractions of seconds.
|
static Translet.Parser<Duration_calendaric> |
parser(boolean lowerLimitForInternals,
boolean upperLimitForLeading)
Returns a parser for calendaric time.
|
Rational |
toRational()
This conversion fails since no translation relation is per default.
|
String |
toString()
Always prints INNER minutes and seconds (i.e.
|
public static final BigDecimal minutes_per_hour
public static final BigDecimal seconds_per_minute
protected int hours
split()
.protected int minutes
protected BigDecimal secondsOnly
protected BigDecimal value
protected boolean isSplit
public Duration_calendaric(BigDecimal s)
s
- Duration in seconds and fractions of seconds.public int get_hours()
public int get_minutes()
get_hours()
.public BigDecimal get_secondsOnly()
get_hours()
* 60 + get_minutes()
.public BigDecimal get_valueInSeconds()
public int compareTo(Duration_calendaric d)
compareTo
in interface Comparable<Duration_calendaric>
public String toString()
public Rational toRational()
toRational
in interface DurationIndication
public static Duration_calendaric fromRational()
public static final Translet.Parser<Duration_calendaric> parser(boolean lowerLimitForInternals, boolean upperLimitForLeading)
12h03'45.678 12h 12h03 ==> NO!! 12h03' 03' = 3' 03'4 = 03'04 03'45.678 03'45 03'45 45.678 123' 123'45.678 123.45678Attention, does not support "leap second", >>0'60"<<
lowerLimitForInternals
- true iff at least two(2) digits must be specified
for minutes/seconds, which are NOT the leading part of the denotation (=which are
an inner text component)upperLimitForLeading
- true iff not more than "59" may be specified for
minutes and seconds, even when they are the leading part of the denotation.