Enum AmericanCoin
- java.lang.Object
-
- java.lang.Enum<AmericanCoin>
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.enums.AmericanCoin
-
- All Implemented Interfaces:
Serializable
,Comparable<AmericanCoin>
public enum AmericanCoin extends Enum<AmericanCoin>
Simple enumeration example defining standard US coins.- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getValue()
The value - in cents - of this coin.static AmericanCoin
valueOf(String name)
Returns the enum constant of this type with the specified name.static AmericanCoin[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PENNY
public static final AmericanCoin PENNY
A Penny, worth 1 cent.
-
NICKEL
public static final AmericanCoin NICKEL
A Nickel, worth 5 cents.
-
DIME
public static final AmericanCoin DIME
A Nickel, worth 5 cents.
-
QUARTER
public static final AmericanCoin QUARTER
-
-
Method Detail
-
values
public static AmericanCoin[] 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 (AmericanCoin c : AmericanCoin.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AmericanCoin 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
-
getValue
public int getValue()
The value - in cents - of this coin.- Returns:
- the value - in cents - of this coin.
-
-