metab
Class Drink

java.lang.Object
  extended bymetab.Drink
All Implemented Interfaces:
java.io.Serializable

public class Drink
extends java.lang.Object
implements java.io.Serializable

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.

Version:
1.03
Author:
Levi Blackstone, Matthew Woller
See Also:
Serialized Form

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

concentration

private double concentration
Concentration of beverage (percent).


volume

private double volume
Volume of beverage (oz).


name

private java.lang.String name
Name of the beverage.

Constructor Detail

Drink

Drink(double concentration,
      double volume,
      java.lang.String name)
Constructor for Drink class.

Parameters:
concentration - Concentration of beverage (percent).
volume - Volume of beverage (oz).
Method Detail

getConcentration

public double getConcentration()
Retrieves concentration of beverage.

Returns:
double representing concentration of beverage (percent).

getName

public java.lang.String getName()
Retrieves the name and description of the drink.

Returns:
String containing the drink name.

getVolume

public double getVolume()
Retrieves volume of beverage.

Returns:
double representing volume of beverage (oz).

getCopy

public Drink getCopy()
Retrieves a copy of beverage concentration and volume (percent, L).

Returns:
Drink representing new instance of current beverage.