|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmetab.Drink
The Drink class is a simple way to represent an alcoholic
beverage. Values used include the ethanol concentration (%), the volume (oz),
and the name of the beverage. The percent volume of ethanol can be determined
by using the total volume and the concentration. This class allows for infinite
numbers of different drinks.
| Field Summary | |
private double |
concentration
Concentration of beverage (percent). |
private java.lang.String |
name
Name of the beverage. |
private double |
volume
Volume of beverage (oz). |
| Constructor Summary | |
(package private) |
Drink(double concentration,
double volume,
java.lang.String name)
Constructor for Drink class. |
| Method Summary | |
double |
getConcentration()
Retrieves concentration of beverage. |
Drink |
getCopy()
Retrieves a copy of beverage concentration and volume (percent, L). |
java.lang.String |
getName()
Retrieves the name and description of the drink. |
double |
getVolume()
Retrieves volume of beverage. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private double concentration
private double volume
private java.lang.String name
| Constructor Detail |
Drink(double concentration,
double volume,
java.lang.String name)
concentration - Concentration of beverage (percent).volume - Volume of beverage (oz).| Method Detail |
public double getConcentration()
double representing concentration of beverage (percent).public java.lang.String getName()
String containing the drink name.public double getVolume()
double representing volume of beverage (oz).public Drink getCopy()
Drink representing new instance of current beverage.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||