Package org.cyclos.entities.utils
Class TimeInterval
- java.lang.Object
-
- org.cyclos.entities.utils.TimeInterval
-
- All Implemented Interfaces:
Cloneable,Comparable<ITimeInterval>,ITimeInterval
@Embeddable public class TimeInterval extends Object implements ITimeInterval, Cloneable
Defines a time interval. It represents an amount of time in the specified unit, i.e.: 5 DAYS.
-
-
Field Summary
Fields Modifier and Type Field Description static TimeIntervalHALF_DAYa time interval of 12 hoursstatic TimeIntervalONE_DAYA time interval of 1 daystatic TimeIntervalONE_HOURa time interval of 1 hourstatic TimeIntervalONE_MONTHA time interval of 1 monthstatic TimeIntervalONE_WEEKa time interval of 1 weekstatic TimeIntervalONE_YEARA time interval of 1 yearstatic TimeIntervalQUARTER_DAYa time interval of 6 hours
-
Constructor Summary
Constructors Constructor Description TimeInterval()TimeInterval(Integer amount, TimeField field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeIntervalclone()booleanequals(Object obj)TimeIntervalfreeze()IntegergetAmount()TimeFieldgetField()inthashCode()voidsetAmount(Integer amount)voidsetField(TimeField field)StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.model.utils.ITimeInterval
compareTo, getMilliseconds, isValid
-
-
-
-
Field Detail
-
ONE_YEAR
public static final TimeInterval ONE_YEAR
A time interval of 1 year
-
ONE_MONTH
public static final TimeInterval ONE_MONTH
A time interval of 1 month
-
ONE_WEEK
public static final TimeInterval ONE_WEEK
a time interval of 1 week
-
ONE_DAY
public static final TimeInterval ONE_DAY
A time interval of 1 day
-
HALF_DAY
public static final TimeInterval HALF_DAY
a time interval of 12 hours
-
QUARTER_DAY
public static final TimeInterval QUARTER_DAY
a time interval of 6 hours
-
ONE_HOUR
public static final TimeInterval ONE_HOUR
a time interval of 1 hour
-
-
Method Detail
-
clone
public TimeInterval clone()
-
freeze
public TimeInterval freeze()
-
getAmount
public Integer getAmount()
- Specified by:
getAmountin interfaceITimeInterval
-
getField
public TimeField getField()
- Specified by:
getFieldin interfaceITimeInterval
-
setAmount
public void setAmount(Integer amount)
-
setField
public void setField(TimeField field)
-
-