net.sf.mpxj
Enum TimeUnit

java.lang.Object
  extended by java.lang.Enum<TimeUnit>
      extended by net.sf.mpxj.TimeUnit
All Implemented Interfaces:
Serializable, Comparable<TimeUnit>, MpxjEnum

public enum TimeUnit
extends Enum<TimeUnit>
implements MpxjEnum

This class contains utility functions allowing time unit specifications to be parsed and formatted.


Enum Constant Summary
DAYS
          Constant representing Days.
ELAPSED_DAYS
          Constant representing Elapsed Days.
ELAPSED_HOURS
          Constant representing Elapsed Hours.
ELAPSED_MINUTES
          Constant representing Elapsed Minutes.
ELAPSED_MONTHS
          Constant representing Elapsed Months.
ELAPSED_PERCENT
          Constant representing Elapsed Percent.
ELAPSED_WEEKS
          Constant representing Elapsed Weeks.
ELAPSED_YEARS
          Constant representing Elapsed Years.
HOURS
          Constant representing Hours.
MINUTES
          Constant representing Minutes.
MONTHS
          Constant representing Months.
PERCENT
          Constant representing Percent.
WEEKS
          Constant representing Weeks.
YEARS
          Constant representing Years.
 
Method Summary
static TimeUnit getInstance(int type)
          Retrieve an instance of the enum based on its int value.
static TimeUnit getInstance(Number type)
          Retrieve an instance of the enum based on its int value.
 String getName()
          Retrieve the name associated with this enum.
 int getValue()
          Accessor method used to retrieve the numeric representation of the enum.
 String toString()
          
static TimeUnit valueOf(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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MINUTES

public static final TimeUnit MINUTES
Constant representing Minutes.


HOURS

public static final TimeUnit HOURS
Constant representing Hours.


DAYS

public static final TimeUnit DAYS
Constant representing Days.


WEEKS

public static final TimeUnit WEEKS
Constant representing Weeks.


MONTHS

public static final TimeUnit MONTHS
Constant representing Months.


PERCENT

public static final TimeUnit PERCENT
Constant representing Percent.


YEARS

public static final TimeUnit YEARS
Constant representing Years.


ELAPSED_MINUTES

public static final TimeUnit ELAPSED_MINUTES
Constant representing Elapsed Minutes.


ELAPSED_HOURS

public static final TimeUnit ELAPSED_HOURS
Constant representing Elapsed Hours.


ELAPSED_DAYS

public static final TimeUnit ELAPSED_DAYS
Constant representing Elapsed Days.


ELAPSED_WEEKS

public static final TimeUnit ELAPSED_WEEKS
Constant representing Elapsed Weeks.


ELAPSED_MONTHS

public static final TimeUnit ELAPSED_MONTHS
Constant representing Elapsed Months.


ELAPSED_YEARS

public static final TimeUnit ELAPSED_YEARS
Constant representing Elapsed Years.


ELAPSED_PERCENT

public static final TimeUnit ELAPSED_PERCENT
Constant representing Elapsed Percent.

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getInstance

public static TimeUnit getInstance(int type)
Retrieve an instance of the enum based on its int value.

Parameters:
type - int type
Returns:
enum instance

getInstance

public static TimeUnit getInstance(Number type)
Retrieve an instance of the enum based on its int value.

Parameters:
type - int type
Returns:
enum instance

getValue

public int getValue()
Accessor method used to retrieve the numeric representation of the enum.

Specified by:
getValue in interface MpxjEnum
Returns:
int representation of the enum

getName

public String getName()
Retrieve the name associated with this enum.

Returns:
name

toString

public String toString()

Overrides:
toString in class Enum<TimeUnit>


Copyright © 2012. All Rights Reserved.