Package at.jku.ssw.fp.sect07_1
Enum PriceGroups
- java.lang.Object
-
- java.lang.Enum<PriceGroups>
-
- at.jku.ssw.fp.sect07_1.PriceGroups
-
- All Implemented Interfaces:
Serializable
,Comparable<PriceGroups>
public enum PriceGroups extends Enum<PriceGroups>
Enumeration for price groups of articles.- Author:
- Herbert Praehofer
-
-
Field Summary
Fields Modifier and Type Field Description private static double
HIGH_BOUND
private static double
LOW_BOUND
-
Constructor Summary
Constructors Modifier Constructor Description private
PriceGroups()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PriceGroups
fromPrice(double price)
Returns the group based on a price value.static PriceGroups
valueOf(String name)
Returns the enum constant of this type with the specified name.static PriceGroups[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOW
public static final PriceGroups LOW
-
MEDIUM
public static final PriceGroups MEDIUM
-
HIGH
public static final PriceGroups HIGH
-
-
Field Detail
-
LOW_BOUND
private static final double LOW_BOUND
- See Also:
- Constant Field Values
-
HIGH_BOUND
private static final double HIGH_BOUND
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static PriceGroups[] 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 (PriceGroups c : PriceGroups.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PriceGroups 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
-
fromPrice
public static PriceGroups fromPrice(double price)
Returns the group based on a price value.- Parameters:
price
- the price value- Returns:
- the price group
-
-