Package net.sf.antcontrib.process
Class Limit.TimeUnit
java.lang.Object
org.apache.tools.ant.types.EnumeratedAttribute
net.sf.antcontrib.process.Limit.TimeUnit
- Enclosing class:
Limit
public static class Limit.TimeUnit
extends org.apache.tools.ant.types.EnumeratedAttribute
The enumeration of units:
millisecond, second, minute, hour, day, week
Todo: we use timestamps in many places, why not factor this out
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Limit.TimeUnitstatic final Stringstatic final Limit.TimeUnitstatic final Stringstatic final Limit.TimeUnitstatic unit objects, for use as sensible defaultsstatic final Stringstatic final Limit.TimeUnitstatic final Stringstatic final Limit.TimeUnitstatic final Stringstatic final Limit.TimeUnitFields inherited from class org.apache.tools.ant.types.EnumeratedAttribute
value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongString[]protected voidsetValueProgrammatically(String value) set the inner value programmatically.longtoMillis(long numberOfUnits) convert the time in the current unit, to millisMethods inherited from class org.apache.tools.ant.types.EnumeratedAttribute
containsValue, getIndex, getInstance, getValue, indexOfValue, setValue, toString
-
Field Details
-
MILLISECOND
- See Also:
-
SECOND
- See Also:
-
MINUTE
- See Also:
-
HOUR
- See Also:
-
DAY
- See Also:
-
WEEK
- See Also:
-
MILLISECOND_UNIT
static unit objects, for use as sensible defaults -
SECOND_UNIT
-
MINUTE_UNIT
-
HOUR_UNIT
-
DAY_UNIT
-
WEEK_UNIT
-
-
Constructor Details
-
TimeUnit
public TimeUnit()
-
-
Method Details
-
setValueProgrammatically
set the inner value programmatically.- Parameters:
value- to set
-
getMultiplier
public long getMultiplier() -
getValues
- Specified by:
getValuesin classorg.apache.tools.ant.types.EnumeratedAttribute
-
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
-