Package ejava.examples.javase5
Enum EnumTest.Rate
- java.lang.Object
-
- java.lang.Enum<EnumTest.Rate>
-
- ejava.examples.javase5.EnumTest.Rate
-
- All Implemented Interfaces:
Serializable
,Comparable<EnumTest.Rate>
- Enclosing class:
- EnumTest
private static enum EnumTest.Rate extends Enum<EnumTest.Rate>
-
-
Field Summary
Fields Modifier and Type Field Description private double
amount
-
Constructor Summary
Constructors Modifier Constructor Description private
Rate(double amount)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
amount()
static EnumTest.Rate
valueOf(String name)
Returns the enum constant of this type with the specified name.static EnumTest.Rate[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUN
public static final EnumTest.Rate SUN
-
MON
public static final EnumTest.Rate MON
-
TUE
public static final EnumTest.Rate TUE
-
WED
public static final EnumTest.Rate WED
-
THU
public static final EnumTest.Rate THU
-
FRI
public static final EnumTest.Rate FRI
-
SAT
public static final EnumTest.Rate SAT
-
-
Method Detail
-
values
public static EnumTest.Rate[] 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 (EnumTest.Rate c : EnumTest.Rate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EnumTest.Rate 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 nameNullPointerException
- if the argument is null
-
amount
public double amount()
-
-