com.google.code.jetm.maven.data
Enum TimeUnit

java.lang.Object
  extended by java.lang.Enum<TimeUnit>
      extended by com.google.code.jetm.maven.data.TimeUnit
All Implemented Interfaces:
Serializable, Comparable<TimeUnit>

public enum TimeUnit
extends Enum<TimeUnit>

Enumerations of the time units supported by this report.

Author:
jrh3k5

Enum Constant Summary
MILLISECONDS
          Milliseconds.
SECONDS
          Seconds
 
Method Summary
 double fromMilliseconds(double micros)
          Convert microseconds to this unit's value.
static TimeUnit fromMojoAbbreviation(String abbreviation)
          Get a time unit from the appropriate TimingReportMojo abbreviate.
 String getDisplayName()
          Get the display name of this time unit.
 long getDivisionValue()
          Get the value by which this unit divides in order to convert from milliseconds to this unit.
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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MILLISECONDS

public static final TimeUnit MILLISECONDS
Milliseconds.


SECONDS

public static final TimeUnit SECONDS
Seconds

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

fromMojoAbbreviation

public static TimeUnit fromMojoAbbreviation(String abbreviation)
Get a time unit from the appropriate TimingReportMojo abbreviate. The comparison is case-insensitive.

Parameters:
abbreviation - The abbreviation from which to obtain the corresponding enumeration.
Returns:
A TimeUnit enumeration corresponding to the given abbreviation:

fromMilliseconds

public double fromMilliseconds(double micros)
Convert microseconds to this unit's value.

Parameters:
micros - The number of microseconds.
Returns:
The given number of microseconds in this unit's measurement.

getDisplayName

public String getDisplayName()
Get the display name of this time unit.

Returns:
The display name of the time unit.

getDivisionValue

public long getDivisionValue()
Get the value by which this unit divides in order to convert from milliseconds to this unit.

Returns:
The division value.


Copyright © 2011. All Rights Reserved.