Class DurationTime
java.lang.Object
com.polarion.core.util.types.duration.DurationTime
- All Implemented Interfaces:
Serializable
,Cloneable
- Author:
- Jiri Banszel, Polarion Software
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDurationTime
(boolean negative, String[] units, boolean allowMixedUnits) Deprecated.DurationTime
(String[] units, boolean allowMixedUnits) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DurationTime durationTime) Adds another DurationTime instance (by adding respective time unit's multiplicity).clone()
boolean
static DurationTime
fromHours
(float hours) Warning: Experimental, precision of conversion can change in the future.static DurationTime
fromString
(String s) Parses duration from a string in decimal format (e.g.float
getHours()
Returns the duration in hours.float
Deprecated.float
Deprecated.float
Deprecated.long
Deprecated.long
getLength
(long oneDayLength) Deprecated.long
Returns the duration in milliseconds.static long
int
hashCode()
boolean
boolean
Checks whether given string is a valid duration description.boolean
isZero()
parseDuration
(String duration) Returns instance of DurationTime that represents given string.void
setCoefficients
(Fraction[] coefficients) Deprecated.void
setNegative
(boolean negative) void
toCollapsedForm
(long oneDayLength) toString()
-
Field Details
-
DAY
- See Also:
-
HOUR
- See Also:
-
MONTH
Deprecated.- See Also:
-
YEAR
Deprecated.- See Also:
-
MIN
Deprecated.- See Also:
-
-
Constructor Details
-
DurationTime
Deprecated. -
DurationTime
Deprecated.- Parameters:
allowMixedUnits
-- Since:
- 3.3
-
-
Method Details
-
setCoefficients
Deprecated. -
isNegative
public boolean isNegative()- Since:
- 3.3
-
setNegative
public void setNegative(boolean negative) - Since:
- 3.3
-
getMillisPerDay
public static long getMillisPerDay()- Since:
- 3.7.1
-
getMillis
public long getMillis()Returns the duration in milliseconds.- Since:
- 3.7.1
-
getHours
public float getHours()Returns the duration in hours.- Since:
- 3.7.1
-
fromHours
Warning: Experimental, precision of conversion can change in the future.- Since:
- 3.7.1
-
fromString
Parses duration from a string in decimal format (e.g. "1.5", "1.5h") or in days-hours format (e.g. "1d 3h"). Returnsnull
for empty ornull
input. Warning: Experimental, precision of conversion can change in the future.- Since:
- 3.7.1
-
add
Adds another DurationTime instance (by adding respective time unit's multiplicity). -
isZero
public boolean isZero() -
toCollapsedForm
public void toCollapsedForm(long oneDayLength) -
parseDuration
Returns instance of DurationTime that represents given string. -
isValid
Checks whether given string is a valid duration description. -
toString
-
equals
-
hashCode
public int hashCode() -
clone
- Since:
- 3.3.2
-
getLength
Deprecated. -
getLength
Deprecated. -
getInDays
Deprecated. -
getInMonths
Deprecated. -
getInYears
Deprecated.
-