org.enblom.time
Enum Month

java.lang.Object
  extended by java.lang.Enum<Month>
      extended by org.enblom.time.Month
All Implemented Interfaces:
Serializable, Comparable<Month>

public enum Month
extends Enum<Month>

A month.

Author:
Andreas Enblom

Enum Constant Summary
APRIL
          April
AUGUST
          August
DECEMBER
          December
FEBRUARY
          February
JANUARY
          January
JULY
          July
JUNE
          June
MARCH
          March
MAY
          May
NOVEMBER
          November
OCTOBER
          October
SEPTEMBER
          September
 
Method Summary
static Month fromNum(int num)
          Returns the month with the given number in the range 1-12.
 int toNum()
           
static Month valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Month[] 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

JANUARY

public static final Month JANUARY
January


FEBRUARY

public static final Month FEBRUARY
February


MARCH

public static final Month MARCH
March


APRIL

public static final Month APRIL
April


MAY

public static final Month MAY
May


JUNE

public static final Month JUNE
June


JULY

public static final Month JULY
July


AUGUST

public static final Month AUGUST
August


SEPTEMBER

public static final Month SEPTEMBER
September


OCTOBER

public static final Month OCTOBER
October


NOVEMBER

public static final Month NOVEMBER
November


DECEMBER

public static final Month DECEMBER
December

Method Detail

values

public static Month[] 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 (Month c : Month.values())
    System.out.println(c);

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

valueOf

public static Month 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

toNum

public int toNum()
Returns:
The number of the month in the range 1-12.

fromNum

public static Month fromNum(int num)
Returns the month with the given number in the range 1-12.

Parameters:
num - The number of the month in the range 1-12.
Returns:
The month with the given number.


Copyright © 2013. All Rights Reserved.