dk.netarkivet.harvester.datamodel
Enum TimeUnit

java.lang.Object
  extended by java.lang.Enum<TimeUnit>
      extended by dk.netarkivet.harvester.datamodel.TimeUnit
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TimeUnit>

public enum TimeUnit
extends java.lang.Enum<TimeUnit>

Enumeration of the possible time units used for frequencies in schedules.


Enum Constant Summary
DAILY
          Daily time unit will result in a frequency where only "on minute" and "on hour" will be set, i.e.
HOURLY
          Hourly time unit will result in a frequency where only "on minute" will be set, i.e.
MONTHLY
          Monthly time unit will result in a frequency where only "on minute", "on hour" and "on day of month" will be set, i.e.
NOTIMEUNIT
          'No time unit' is only included for historic reasons, since 0 did not denote a timeunit.
WEEKLY
          Weekly time unit will result in a frequency where only "on minute", "on hour" and "on day of week" will be set, i.e.
 
Method Summary
static TimeUnit fromOrdinal(int tu)
          Helper method that gives a proper object from e.g.
static TimeUnit valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TimeUnit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOTIMEUNIT

public static final TimeUnit NOTIMEUNIT
'No time unit' is only included for historic reasons, since 0 did not denote a timeunit.


HOURLY

public static final TimeUnit HOURLY
Hourly time unit will result in a frequency where only "on minute" will be set, i.e. "on hour", "on day of week" and "on day of month" are unused.


DAILY

public static final TimeUnit DAILY
Daily time unit will result in a frequency where only "on minute" and "on hour" will be set, i.e. "on day of week" and "on day of month" are unused.


WEEKLY

public static final TimeUnit WEEKLY
Weekly time unit will result in a frequency where only "on minute", "on hour" and "on day of week" will be set, i.e. "on day of month" is unused.


MONTHLY

public static final TimeUnit MONTHLY
Monthly time unit will result in a frequency where only "on minute", "on hour" and "on day of month" will be set, i.e. "on day of week" is unused.

Method Detail

values

public static TimeUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TimeUnit c : TimeUnit.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TimeUnit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

fromOrdinal

public static TimeUnit fromOrdinal(int tu)
Helper method that gives a proper object from e.g. a DB-stored value.

Parameters:
tu - a certain integer for a timeunit
Returns:
the TimeUnit related to a certain integer
Throws:
ArgumentNotValid - If argument tu is invalid (i.e. does not correspond to a TimeUnit)