public class Duration extends java.lang.Object implements Operand
Duration duration = Duration.days(5.0);
to get a duration objectLogicCriteria
Modifier and Type | Class and Description |
---|---|
static class |
Duration.Units |
Modifier and Type | Method and Description |
---|---|
static Duration |
days(java.lang.Double duration)
Returns a duration for the given number of days
|
static Duration |
days(int duration)
Returns a duration for the given number of days
|
java.lang.Double |
getDuration() |
java.lang.Double |
getDurationInDays()
Returns the equivalent duration in days
|
long |
getDurationInMillis()
Returns the equivalent duration in milliseconds
|
Duration.Units |
getUnits() |
static Duration |
hours(java.lang.Double duration)
Returns a duration for the given number of hours
|
static Duration |
hours(int duration)
Returns a duration for the given number of hours
|
static Duration |
minutes(java.lang.Double duration)
Returns a duration for the given number of minutes
|
static Duration |
minutes(int duration)
Returns a duration for the given number of minutes
|
static Duration |
months(java.lang.Double duration)
Returns a duration for the given number of months
|
static Duration |
months(int duration)
Returns a duration for the given number of months
|
static Duration |
seconds(java.lang.Double duration)
Returns a duration for the given number of seconds
|
static Duration |
seconds(int duration)
Returns a duration for the given number of seconds
|
boolean |
supports(ComparisonOperator operator)
Sanity check for this Operand vs a given operator.
|
static Duration |
weeks(java.lang.Double duration)
Returns a duration for the given number of weeks
|
static Duration |
weeks(int duration)
Returns a duration for the given number of weeks
|
static Duration |
years(java.lang.Double duration)
Returns a duration for the given number of years
|
static Duration |
years(int duration)
Returns a duration for the given number of years
|
public java.lang.Double getDuration()
public Duration.Units getUnits()
public java.lang.Double getDurationInDays()
public long getDurationInMillis()
public static Duration seconds(java.lang.Double duration)
duration
- number of seconds for durationDuration
object for given number of secondspublic static Duration seconds(int duration)
duration
- number of seconds for durationDuration
object for given number of secondspublic static Duration minutes(java.lang.Double duration)
duration
- number of minutes for durationDuration
object for given number of minutespublic static Duration minutes(int duration)
duration
- number of minutes for durationDuration
object for given number of minutespublic static Duration hours(java.lang.Double duration)
duration
- number of hours for durationDuration
object for given number of hourspublic static Duration hours(int duration)
duration
- number of hours for durationDuration
object for given number of hourspublic static Duration days(java.lang.Double duration)
duration
- number of days for durationDuration
object with specified number of dayspublic static Duration days(int duration)
duration
- number of days for durationDuration
object with specified number of dayspublic static Duration weeks(java.lang.Double duration)
duration
- number of weeks for durationDuration
object with specified number of weekspublic static Duration weeks(int duration)
duration
- number of weeks for durationDuration
object with specified number of weekspublic static Duration months(java.lang.Double duration)
duration
- number of months for durationDuration
object with specified number of monthspublic static Duration months(int duration)
duration
- number of months for durationDuration
object with specified number of monthspublic static Duration years(java.lang.Double duration)
duration
- number of years for durationDuration
object with specified number of yearspublic static Duration years(int duration)
duration
- number of years for durationDuration
object with specified number of yearspublic boolean supports(ComparisonOperator operator)
Operand
OperandDate
.supports("BEFORE") but OperandConcept
.supports("BEFORE") returns falsesupports
in interface Operand
operator
- The operator to test against this OperandComparisonOperator
Operand.supports(org.openmrs.logic.op.ComparisonOperator)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.