|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openmrs.logic.Duration
public class Duration
Represents a duration of time — e.g., one year, two weeks, or 18 months. Used within
criteria.
Use the Duration duration = Duration.days(5.0);
to get a duration object
LogicCriteria
Nested Class Summary | |
---|---|
static class |
Duration.Units
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 duration
Duration
object for given number of secondspublic static Duration seconds(int duration)
duration
- number of seconds for duration
Duration
object for given number of secondspublic static Duration minutes(java.lang.Double duration)
duration
- number of minutes for duration
Duration
object for given number of minutespublic static Duration minutes(int duration)
duration
- number of minutes for duration
Duration
object for given number of minutespublic static Duration hours(java.lang.Double duration)
duration
- number of hours for duration
Duration
object for given number of hourspublic static Duration hours(int duration)
duration
- number of hours for duration
Duration
object for given number of hourspublic static Duration days(java.lang.Double duration)
duration
- number of days for duration
Duration
object with specified number of dayspublic static Duration days(int duration)
duration
- number of days for duration
Duration
object with specified number of dayspublic static Duration weeks(java.lang.Double duration)
duration
- number of weeks for duration
Duration
object with specified number of weekspublic static Duration weeks(int duration)
duration
- number of weeks for duration
Duration
object with specified number of weekspublic static Duration months(java.lang.Double duration)
duration
- number of months for duration
Duration
object with specified number of monthspublic static Duration months(int duration)
duration
- number of months for duration
Duration
object with specified number of monthspublic static Duration years(java.lang.Double duration)
duration
- number of years for duration
Duration
object with specified number of yearspublic static Duration years(int duration)
duration
- number of years for duration
Duration
object with specified number of yearspublic boolean supports(ComparisonOperator operator)
Operand
OperandDate
.supports("BEFORE")
but OperandConcept
.supports("BEFORE") returns false
supports
in interface Operand
operator
- The operator to test against this Operand
ComparisonOperator
Operand.supports(org.openmrs.logic.op.ComparisonOperator)
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |