foodManagement
Class Entree

java.lang.Object
  extended by foodManagement.Entree
All Implemented Interfaces:
Listable

public class Entree
extends java.lang.Object
implements Listable

An IMMUTABLE class that represents a list of food and a name. For example, a typical entree might be called "Big Bubba Breakfast" and might consist of the list: 2 Egg, 3 Waffle, 1 Bacon, 1 Coffee


Constructor Summary
Entree(java.lang.String nameIn, SortedListOfImmutables foodListIn)
          Standard constructor.
 
Method Summary
 boolean equals(Entree other)
          Compares the current object to the parameter and returns true if they have the same name.
 SortedListOfImmutables getFoodList()
          Getter for FoodList for this entree.
 java.lang.String getName()
          Getter for name of Entree
 int getRetailValue()
          Returns the retail value of the food in this entree
 int getWholesaleCost()
          Returns the wholesale cost of the food in this entree
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entree

public Entree(java.lang.String nameIn,
              SortedListOfImmutables foodListIn)
Standard constructor. To ensure that the Entree class remains immutable, this constructor will make a copy of the list that foodListIn refers to. (This is necessary because a SortedListOfImmutables is mutable.)

Parameters:
nameIn - desired name for this Entree
foodListIn - desired list of Food for this Entree
Method Detail

getName

public java.lang.String getName()
Getter for name of Entree

Specified by:
getName in interface Listable
Returns:
reference to the name of Entree

getFoodList

public SortedListOfImmutables getFoodList()
Getter for FoodList for this entree.

Returns:
reference to a copy of the FoodList for this entree

getWholesaleCost

public int getWholesaleCost()
Returns the wholesale cost of the food in this entree

Specified by:
getWholesaleCost in interface Listable
Returns:
wholesale cost of the food in this entree

getRetailValue

public int getRetailValue()
Returns the retail value of the food in this entree

Specified by:
getRetailValue in interface Listable
Returns:
retail value of the food in this entree

equals

public boolean equals(Entree other)
Compares the current object to the parameter and returns true if they have the same name.

Parameters:
other - Entree to be compared to the current object
Returns:
true if the current object and the parameter have the same name, false otherwise

toString

public java.lang.String toString()
Specified by:
toString in interface Listable
Overrides:
toString in class java.lang.Object


Web Accessibility