Package org.dashbuilder.dataset.date
Class TimeAmount
- java.lang.Object
-
- org.dashbuilder.dataset.date.TimeAmount
-
public class TimeAmount extends Object
Class for the definition of time quantitys, both positive and negative. For example:- 10second
- -1year
- +2quarter
-
-
Constructor Summary
Constructors Constructor Description TimeAmount()TimeAmount(long quantity, DateIntervalType sizeType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadjustDate(Date d)TimeAmountcloneInstance()longgetQuantity()DateIntervalTypegetType()static TimeAmountparse(String timeAmount)Parses a time amount expression.voidsetQuantity(long quantity)voidsetType(DateIntervalType type)longtoMillis()StringtoString()
-
-
-
Constructor Detail
-
TimeAmount
public TimeAmount()
-
TimeAmount
public TimeAmount(long quantity, DateIntervalType sizeType)
-
-
Method Detail
-
getQuantity
public long getQuantity()
-
setQuantity
public void setQuantity(long quantity)
-
getType
public DateIntervalType getType()
-
setType
public void setType(DateIntervalType type)
-
toMillis
public long toMillis()
-
cloneInstance
public TimeAmount cloneInstance()
-
adjustDate
public void adjustDate(Date d)
-
parse
public static TimeAmount parse(String timeAmount)
Parses a time amount expression. For example: "10second", "-1year", ...- Returns:
- A TimeAmount instance.
- Throws:
IllegalArgumentException- If the expression is not valid
-
-