Package ise.antelope.tasks
Class TimeUnit
- java.lang.Object
-
- org.apache.tools.ant.types.EnumeratedAttribute
-
- ise.antelope.tasks.TimeUnit
-
public class TimeUnit extends org.apache.tools.ant.types.EnumeratedAttribute
The enumeration of units: millisecond, second, minute, hour, day, week, month, year.- Version:
- $Revision: 132 $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DAY
static TimeUnit
DAY_UNIT
static java.lang.String
HOUR
static TimeUnit
HOUR_UNIT
static java.lang.String
MILLISECOND
static TimeUnit
MILLISECOND_UNIT
static unit objects, for use as sensible defaultsstatic java.lang.String
MINUTE
static TimeUnit
MINUTE_UNIT
static java.lang.String
MONTH
static java.lang.String
SECOND
static TimeUnit
SECOND_UNIT
static java.lang.String
WEEK
static TimeUnit
WEEK_UNIT
static java.lang.String
YEAR
-
Constructor Summary
Constructors Constructor Description TimeUnit()
Constructor for TimeUnit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getMultiplier()
Gets the multiplier attribute of the TimeUnit objectjava.lang.String[]
getValues()
Gets the values attribute of the TimeUnit objectprotected void
setValueProgrammatically(java.lang.String value)
set the inner value programmatically.long
toMillis(long numberOfUnits)
convert the time in the current unit, to millis
-
-
-
Field Detail
-
MILLISECOND
public static final java.lang.String MILLISECOND
- See Also:
- Constant Field Values
-
SECOND
public static final java.lang.String SECOND
- See Also:
- Constant Field Values
-
MINUTE
public static final java.lang.String MINUTE
- See Also:
- Constant Field Values
-
HOUR
public static final java.lang.String HOUR
- See Also:
- Constant Field Values
-
DAY
public static final java.lang.String DAY
- See Also:
- Constant Field Values
-
WEEK
public static final java.lang.String WEEK
- See Also:
- Constant Field Values
-
MONTH
public static final java.lang.String MONTH
- See Also:
- Constant Field Values
-
YEAR
public static final java.lang.String YEAR
- See Also:
- Constant Field Values
-
MILLISECOND_UNIT
public static final TimeUnit MILLISECOND_UNIT
static unit objects, for use as sensible defaults
-
SECOND_UNIT
public static final TimeUnit SECOND_UNIT
-
MINUTE_UNIT
public static final TimeUnit MINUTE_UNIT
-
HOUR_UNIT
public static final TimeUnit HOUR_UNIT
-
DAY_UNIT
public static final TimeUnit DAY_UNIT
-
WEEK_UNIT
public static final TimeUnit WEEK_UNIT
-
-
Method Detail
-
setValueProgrammatically
protected void setValueProgrammatically(java.lang.String value)
set the inner value programmatically.- Parameters:
value
- to set
-
getMultiplier
public long getMultiplier()
Gets the multiplier attribute of the TimeUnit object- Returns:
- The multiplier value
-
getValues
public java.lang.String[] getValues()
Gets the values attribute of the TimeUnit object- Specified by:
getValues
in classorg.apache.tools.ant.types.EnumeratedAttribute
- Returns:
- The values value
-
toMillis
public long toMillis(long numberOfUnits)
convert the time in the current unit, to millis- Parameters:
numberOfUnits
- long expressed in the current objects units- Returns:
- long representing the value in millis
-
-