de.laliluna.date
Enum Months

java.lang.Object
  extended by java.lang.Enum<Months>
      extended by de.laliluna.date.Months
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Months>

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

Enum representing the months of the year. There are converting methods from int to the enum and back. Finally you can get the english abbreviation or full name for the month.


Enum Constant Summary
APR
           
AUG
           
DEC
           
FEB
           
JAN
           
JUL
           
JUN
           
MAR
           
MAY
           
NOV
           
OCT
           
SEP
           
 
Field Summary
static java.lang.String[] names
           
static java.lang.String[] shortNames
           
 
Method Summary
 java.lang.String toName()
          Returns an english month name of this instance
 java.lang.String toNameShort()
          Returns a english abbreviation for the month name of this instance
 int toValue()
          Returns the int value corresponding to the month 1 corresponds to JAN, 2 to FEB, ...
static Months valueOf(int monthValue)
          Returns the month enum corresponding to the value of monthValue 1 corresponds to JAN, 2 to FEB, ...
static Months valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Months[] 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

JAN

public static final Months JAN

FEB

public static final Months FEB

MAR

public static final Months MAR

APR

public static final Months APR

MAY

public static final Months MAY

JUN

public static final Months JUN

JUL

public static final Months JUL

AUG

public static final Months AUG

SEP

public static final Months SEP

OCT

public static final Months OCT

NOV

public static final Months NOV

DEC

public static final Months DEC
Field Detail

shortNames

public static final java.lang.String[] shortNames

names

public static final java.lang.String[] names
Method Detail

values

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

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

valueOf

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

toNameShort

public java.lang.String toNameShort()
Returns a english abbreviation for the month name of this instance

Returns:
an english abbreviation for the month

toName

public java.lang.String toName()
Returns an english month name of this instance

Returns:
an english month name

valueOf

public static Months valueOf(int monthValue)
Returns the month enum corresponding to the value of monthValue 1 corresponds to JAN, 2 to FEB, ...

Parameters:
monthValue - - value representing a month
Returns:
- the month enum corresponding to the param value

toValue

public int toValue()
Returns the int value corresponding to the month 1 corresponds to JAN, 2 to FEB, ...

Returns:
int value of the month


Copyright © 2009 Sebastian Hennebrueder, http://www.laliluna.de