sjm.examples.chips
Class Chip
java.lang.Object
|
+--sjm.examples.chips.Chip
- public class Chip
- extends java.lang.Object
A chip is a type of potato or corn chip that a mythical
company offers.
|
Field Summary |
protected java.lang.Integer |
chipID
|
protected java.lang.String |
chipName
|
protected java.lang.String |
oil
|
protected java.lang.Double |
ounces
|
protected java.lang.Double |
price
|
|
Constructor Summary |
Chip(java.lang.Integer chipID,
java.lang.String chipName,
java.lang.Double price,
java.lang.Double ounces,
java.lang.String oil)
Create a chip given its ID, name, price per bag, ounces
per bag, and type of oil. |
Chip(int chipID,
java.lang.String chipName,
double price,
double ounces,
java.lang.String oil)
Create a chip given its ID, name, price per bag, ounces
per bag, and type of oil. |
|
Method Summary |
java.lang.Integer |
getChipID()
Return the ID of this type of chip. |
java.lang.String |
getChipName()
Return the name of this type of chip. |
java.lang.String |
getOil()
Return the type of oil the company uses for this chip. |
java.lang.Double |
getOunces()
Return the number of ounces in a bag of this type of chip. |
java.lang.Double |
getPrice()
Return the prince of this type of chip. |
java.lang.String |
toString()
Return a textual description of this chip. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
chipID
protected java.lang.Integer chipID
chipName
protected java.lang.String chipName
price
protected java.lang.Double price
ounces
protected java.lang.Double ounces
oil
protected java.lang.String oil
Chip
public Chip(int chipID,
java.lang.String chipName,
double price,
double ounces,
java.lang.String oil)
- Create a chip given its ID, name, price per bag, ounces
per bag, and type of oil.
Chip
public Chip(java.lang.Integer chipID,
java.lang.String chipName,
java.lang.Double price,
java.lang.Double ounces,
java.lang.String oil)
- Create a chip given its ID, name, price per bag, ounces
per bag, and type of oil.
getChipID
public java.lang.Integer getChipID()
- Return the ID of this type of chip.
- Returns:
- the ID of this type of chip
getChipName
public java.lang.String getChipName()
- Return the name of this type of chip.
- Returns:
- the name of this type of chip
getOil
public java.lang.String getOil()
- Return the type of oil the company uses for this chip.
- Returns:
- the type of oil the company uses for this chip
getOunces
public java.lang.Double getOunces()
- Return the number of ounces in a bag of this type of chip.
- Returns:
- the number of ounces in a bag of this type of chip
getPrice
public java.lang.Double getPrice()
- Return the prince of this type of chip.
- Returns:
- the price of this type of chip
toString
public java.lang.String toString()
- Return a textual description of this chip.
- Overrides:
- toString in class java.lang.Object
- Returns:
- a textual description of this chip