food,banana,5,200.0
food,bread,10,120.0
household,toaster,5
household,washer,200
Inheritance and Interfaces
Overview
In this homework, you will implement a system that
• reads in an inventory file,
• prints the inventory to the console, and
• ships items.
It requires you to use Java classes and interfaces rather than static functions as we did in previous
homework.
Basic Application
In this homework, you will create the basic application that reads input from a datafile and writes
the results to the console. In the next homework, you will enhance the application by adding
database functionality.
Program Flow
The following pseudocode shows the required flow of the program.
Begin
For each line in inventory file do
determine inventory type
based on type, create object to hold data
(FoodItem or Household Item)
populate item with appropriate data (weight, etc)
Store in inventory list
End
For each item in inventory list do
print item
End
For each household item in inventory do
determine shipping cost
print shipping cost
End
End
Program Output
For the supplied input file, the output should be as shown below (dates will be different!)
Item banana
-- Shelf Life: 5
-- Remove from Shelf: Thu Mar 12 22:07:56 CDT 2015
-- Calories: 200.00
Item bread
-- Shelf Life: 10
-- Remove from Shelf: Tue Mar 17 22:07:56 CDT 2015
-- Calories: 120.00
Item toaster
-- Weight: 5
Item washer
-- Weight: 200
Item toaster shipped. Shipping cost is $100.00
Item washer shipped. Shipping cost is $4,000.00
Business Rules
There are two types of items tracked in the system: food items and household (durable) items.
• Food Items
Food items are edible (we hope!) and perishable. An edible item has calories, while a perishable
item has a limited shelf life. The item must be removed from the shelf when it expires. The expi-
ration date is simply
expiration date = date placed in inventory + shelf life in days
• Household Items
Household items have unlimited shelf life, so they do not have an expiration date. They do have
(sometimes substantial) weight. Their weight is taken into account when determining the ship-
ping cost. The shipping cost is also higher when the item is shipped on the weekend.
UML Diagram
The classes and interfaces required for the application have been defined for you, and are shown
in the diagram below. Dotted lines indicate interfaces while solid lines indicate inheritance. Your
application must implement all classes and interfaces as shown.
Javadoc
The Javadoc for the application has been generated for you and is available as a
zip file. Unzip the file into a directory and then open the file index.html to view the
documentation.
javadoc/.DS_Store
javadoc/allclasses-frame.htmlAll ClassesEdibleFoodItemHouseholdItemInventoryItemInventoryManagerPerishableShippable
javadoc/allclasses-noframe.htmlAll Class.
1. food,banana,5,200.0
food,bread,10,120.0
household,toaster,5
household,washer,200
Inheritance and Interfaces
Overview
In this homework, you will implement a system that
• reads in an inventory file,
• prints the inventory to the console, and
• ships items.
It requires you to use Java classes and interfaces rather than
static functions as we did in previous
homework.
Basic Application
In this homework, you will create the basic application that
reads input from a datafile and writes
the results to the console. In the next homework, you will
enhance the application by adding
database functionality.
2. Program Flow
The following pseudocode shows the required flow of the
program.
Begin
For each line in inventory file do
determine inventory type
based on type, create object to hold data
(FoodItem or Household Item)
populate item with appropriate data (weight, etc)
Store in inventory list
End
For each item in inventory list do
print item
End
For each household item in inventory do
determine shipping cost
print shipping cost
3. End
End
Program Output
For the supplied input file, the output should be as shown below
(dates will be different!)
Item banana
-- Shelf Life: 5
-- Remove from Shelf: Thu Mar 12 22:07:56 CDT 2015
-- Calories: 200.00
Item bread
-- Shelf Life: 10
-- Remove from Shelf: Tue Mar 17 22:07:56 CDT 2015
-- Calories: 120.00
Item toaster
-- Weight: 5
Item washer
4. -- Weight: 200
Item toaster shipped. Shipping cost is $100.00
Item washer shipped. Shipping cost is $4,000.00
Business Rules
There are two types of items tracked in the system: food items
and household (durable) items.
• Food Items
Food items are edible (we hope!) and perishable. An edible item
has calories, while a perishable
item has a limited shelf life. The item must be removed from the
shelf when it expires. The expi-
ration date is simply
expiration date = date placed in inventory + shelf life in days
• Household Items
Household items have unlimited shelf life, so they do not have
an expiration date. They do have
(sometimes substantial) weight. Their weight is taken into
account when determining the ship-
ping cost. The shipping cost is also higher when the item is
shipped on the weekend.
UML Diagram
5. The classes and interfaces required for the application have
been defined for you, and are shown
in the diagram below. Dotted lines indicate interfaces while
solid lines indicate inheritance. Your
application must implement all classes and interfaces as shown.
Javadoc
The Javadoc for the application has been generated for you and
is available as a
zip file. Unzip the file into a directory and then open the file
index.html to view the
documentation.
javadoc/.DS_Store
javadoc/allclasses-
frame.htmlAll ClassesEdibleFoodItemHouseholdItemInventoryIt
emInventoryManagerPerishableShippable
javadoc/allclasses-
noframe.htmlAll ClassesEdibleFoodItemHouseholdItemInventor
yItemInventoryManagerPerishableShippable
javadoc/constant-values.html
JavaScript is disabled on your browser.
6. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll ClassesConstant Field Values
ContentsSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll Classes
javadoc/deprecated-list.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll ClassesDeprecated API
ContentsSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll Classes
javadoc/help-doc.html
JavaScript is disabled on your browser.
7. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll ClassesHow This API Document Is Organized
This API (Application Programming Interface) document has
pages corresponding to the items in the navigation bar,
described as follows.
Package
Each package has a page that contains a list of its classes and
interfaces, with a summary for each. This page can contain six
categories:Interfaces
(italic)ClassesEnumsExceptionsErrorsAnnotation Types
Class/Interface
Each class, interface, nested class and nested interface has its
own separate page. Each of these pages has three sections
consisting of a class/interface description, summary tables, and
detailed member descriptions:Class inheritance diagramDirect
SubclassesAll Known SubinterfacesAll Known Implementing
ClassesClass/interface declarationClass/interface
descriptionNested Class SummaryField SummaryConstructor
SummaryMethod SummaryField DetailConstructor
DetailMethod Detail
Each summary entry contains the first sentence from the
detailed description for that item. The summary entries are
alphabetical, while the detailed descriptions are in the order
they appear in the source code. This preserves the logical
groupings established by the programmer.
8. Annotation Type
Each annotation type has its own separate page with the
following sections:Annotation Type declarationAnnotation Type
descriptionRequired Element SummaryOptional Element
SummaryElement Detail
Enum
Each enum has its own separate page with the following
sections:Enum declarationEnum descriptionEnum Constant
SummaryEnum Constant Detail
Tree (Class Hierarchy)
There is a Class Hierarchy page for all packages, plus a
hierarchy for each package. Each hierarchy page contains a list
of classes and a list of interfaces. The classes are organized by
inheritance structure starting with java.lang.Object. The
interfaces do not inherit from java.lang.Object.When viewing
the Overview page, clicking on "Tree" displays the hierarchy
for all packages.When viewing a particular package, class or
interface page, clicking "Tree" displays the hierarchy for only
that package.
Deprecated API
The Deprecated API page lists all of the API that have been
deprecated. A deprecated API is not recommended for use,
generally due to improvements, and a replacement API is
usually given. Deprecated APIs may be removed in future
implementations.
Index
The Index contains an alphabetic list of all classes, interfaces,
constructors, methods, and fields.
Prev/Next
These links take you to the next or previous class, interface,
package, or related page.
9. Frames/No Frames
These links show and hide the HTML frames. All pages are
available with or without frames.
All Classes
The All Classes link shows all classes and interfaces except
non-static nested types.
Serialized Form
Each serializable or externalizable class has a description of its
serialization fields and methods. This information is of interest
to re-implementors, not to developers using the API. While
there is no link in the navigation bar, you can get to this
information by going to any serialized class and clicking
"Serialized Form" in the "See also" section of the class
description.
Constant Field Values
The Constant Field Values page lists the static final fields and
their values.
This help file applies to API documentation generated using the
standard doclet.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll Classes
javadoc/Householditems/.DS_Store
javadoc/Householditems/Householditems/.DS_Store
javadoc/Householditems/Householditems/Householditems/Edibl
10. e.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
Interface EdibleAll Known Implementing
Classes:FoodItempublic interface Edible
Interface for items that are edible
Method Summary
All Methods Instance MethodsAbstract MethodsModifier and
TypeMethod and DescriptiondoublegetCalories() Method
DetailgetCaloriesdouble getCalories()Returns:calories in the
itemSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
11. | MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/FoodI
tem.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
Class
FoodItemjava.lang.Objectuh.edu.cis2348.InventoryItemuh.edu.c
is2348.FoodItemAll Implemented Interfaces:Edible,
Perishablepublic class FoodItem
extends InventoryItem
implements Edible, Perishable
Encapsulates food items
Field Summary
12. Fields Modifier and TypeField and Descriptionprivate
double_caloriesprivate int_shelfLifeprivate
java.util.Date_stockedDateprivate java.util.Date_unusableDate
Fields inherited from
class uh.edu.cis2348.InventoryItem_nameConstructor Summary
Constructors Constructor and
DescriptionFoodItem(java.lang.String name,
int shelfLife,
double calories)
Create a new food item
Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and DescriptiondoublegetCalories()
Returns the calories in the food item
java.util.DategetExpiredDate()
This function returns the expiration date of the product based on
its shelf life and the day that it was added to inventory
intgetShelfLife()
Returns the number of days that a product can remain on the
shelves before being thrown out
java.lang.StringtoString()
Methods inherited from
class uh.edu.cis2348.InventoryItemgetNameMethods inherited
from class java.lang.Object
13. clone, equals, finalize, getClass, hashCode, notify, notifyAll,
wait, wait, waitField Detail_shelfLifeprivate final int
_shelfLife_caloriesprivate final double
_calories_stockedDateprivate final java.util.Date
_stockedDate_unusableDateprivate final java.util.Date
_unusableDateConstructor
DetailFoodItempublic FoodItem(java.lang.String name,
int shelfLife,
double calories)
Create a new food item
Parameters:name - shelfLife - calories - Method
DetailgetCaloriespublic double getCalories()
Returns the calories in the food item
Specified by:getCalories in
interface EdibleReturns:getShelfLifepublic int getShelfLife()
Description copied from interface: Perishable
Returns the number of days that a product can remain on the
shelves before being thrown out
Specified by:getShelfLife in interface PerishableReturns:the
shelf life in
daysgetExpiredDatepublic java.util.Date getExpiredDate()
Description copied from interface: Perishable
14. This function returns the expiration date of the product based on
its shelf life and the day that it was added to inventory
Specified by:getExpiredDate in interface PerishableReturns:the
expiration date, equal to the stock date plus the shelf
lifetoStringpublic java.lang.String toString()Overrides:toString
in class InventoryItemSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/Hous
eholdItem.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
Class
HouseholdItemjava.lang.Objectuh.edu.cis2348.InventoryItemuh.
edu.cis2348.HouseholdItemAll Implemented
15. Interfaces:Shippablepublic class HouseholdItem
extends InventoryItem
implements Shippable
Encapsulates durable items for the house, such as toasters and
dryers
Field Summary
Fields Modifier and TypeField and Descriptionprivate
int_weight
the weight of the item, used in calculating the shipping cost
Fields inherited from
class uh.edu.cis2348.InventoryItem_nameConstructor Summary
Constructors Constructor and
DescriptionHouseholdItem(java.lang.String name,
int weight)
Constructor
Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and
DescriptiondoublecalculateShippingCost(java.lang.String shipD
ateString)
Calculates the shipping cost of the item based on its weight
and whether it was shipped on a Saturday or Sunday.
16. private booleanisWeekend(java.util.Date shipDate)
Determines if the given date is on a weekend.
java.lang.StringtoString()
Methods inherited from
class uh.edu.cis2348.InventoryItemgetNameMethods inherited
from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
wait, wait, waitField Detail_weightprivate final int _weight
the weight of the item, used in calculating the shipping cost
Constructor
DetailHouseholdItempublic HouseholdItem(java.lang.String na
me,
int weight)
Constructor
Parameters:name - weight - Method
DetailcalculateShippingCostpublic double calculateShippingCos
t(java.lang.String shipDateString)
throws java.text.ParseException
Calculates the shipping cost of the item based on its weight
and whether it was shipped on a Saturday or Sunday.
cost = weight * 20 + fee, where fee = $10.00 if on a Saturday
or Sunday, 0 otherwise
Specified by:calculateShippingCost in
17. interface ShippableParameters:shipDateString - - the date of
shipment, in 'mm-dd-yyyy'
formReturns:Throws:java.text.ParseExceptionisWeekendprivate
boolean isWeekend(java.util.Date shipDate)
Determines if the given date is on a weekend.
Parameters:shipDate -
Returns:toStringpublic java.lang.String toString()Overrides:toSt
ring in class InventoryItemSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/Inven
toryItem.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
18. Class
InventoryItemjava.lang.Objectuh.edu.cis2348.InventoryItemDir
ect Known Subclasses:FoodItem, HouseholdItempublic abstract
class InventoryItem
extends java.lang.Object
Abstract class that is the base of all inventory items
Field Summary
Fields Modifier and TypeField and Descriptionprotected
java.lang.String_nameConstructor Summary
Constructors Constructor and
DescriptionInventoryItem(java.lang.String name)
Constructs a new inventory item
Method Summary
All Methods Instance MethodsConcrete MethodsModifier and
TypeMethod and
Descriptionjava.lang.StringgetName() java.lang.StringtoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
wait, wait, waitField Detail_nameprotected java.lang.String
_nameConstructor
DetailInventoryItempublic InventoryItem(java.lang.String name
)
19. Constructs a new inventory item
Parameters:name - Method
DetailgetNamepublic java.lang.String getName()Returns:the
name of the
objecttoStringpublic java.lang.String toString()Overrides:toStri
ng in class java.lang.ObjectSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/Inven
toryManager.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
Class
InventoryManagerjava.lang.Objectuh.edu.cis2348.InventoryMan
20. agerpublic class InventoryManager
extends java.lang.Object
The main class for the inventory management system
Field Summary
Fields Modifier and TypeField and Description(package private)
java.util.ArrayList<InventoryItem>_inventory
the list of all items in inventory
Constructor Summary
Constructors Constructor and
DescriptionInventoryManager() Method Summary
All Methods Static MethodsInstance MethodsConcrete
MethodsModifier and TypeMethod and Descriptionprivate
voidloadInventory()
Loads inventory from the database
private voidloadInventory(java.lang.String fileName)
Reads in the inventory file, storing the contents in the
_inventory list.
static voidmain(java.lang.String[] args)
This is the entry point for the application.
voidprintInventory()
Prints the inventory to the console
voidshipAllHouseholdItems(java.lang.String dateString)
21. This function finds all the household inventory items in the
inventory.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, waitField
Detail_inventoryjava.util.ArrayList<InventoryItem> _inventory
the list of all items in inventory
Constructor
DetailInventoryManagerpublic InventoryManager()Method
Detailmainpublic static void main(java.lang.String[] args)
This is the entry point for the application. It does the following
loads the inventory file
prints the inventory to the console
ships all the household items in inventory, with a ship
date of Dec. 24, 2014.
Parameters:args -
shipAllHouseholdItemspublic void shipAllHouseholdItems(java.
lang.String dateString)
This function finds all the household inventory items in the
inventory. It then
calls calculateShippingCost on each of the items and prints the
result.
22. Parameters:dateString - - the ship date in the format 'mm-dd-
yyyy'loadInventoryprivate void loadInventory(java.lang.String f
ileName)
throws java.io.FileNotFoundException
Reads in the inventory file, storing the contents in the
_inventory list.
Each line from the given CSV file is parsed as a single
inventory element.
The input file can contain two inventory types: food and
household goods.
The format for a line in the CSV file is different for each type.
Column 1Column 2Column 3Column 4foodnameshelf
lifecalorieshouseholdnameweight(NA)Parameters:fileName -
full path to inventory CSV
fileThrows:java.io.FileNotFoundExceptionloadInventoryprivate
void loadInventory()
Loads inventory from the database
printInventorypublic void printInventory()
Prints the inventory to the console
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/packa
ge-frame.htmluh.edu.cis2348
24. InventoryManager
The main class for the inventory management system
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev PackageNext P
ackageFramesNo FramesAll Classes
javadoc/Householditems/Householditems/Householditems/packa
ge-tree.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll ClassesHierarchy For Package uh.edu.cis2348
Class Hierarchyjava.lang.Object
uh.edu.cis2348.InventoryItemuh.edu.cis2348.FoodItem
(implements uh.edu.cis2348.Edible,
uh.edu.cis2348.Perishable)uh.edu.cis2348.HouseholdItem
(implements
uh.edu.cis2348.Shippable)uh.edu.cis2348.InventoryManager
Interface
Hierarchyuh.edu.cis2348.Edibleuh.edu.cis2348.Perishableuh.ed
u.cis2348.ShippableSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll Classes
javadoc/Householditems/Householditems/Householditems/Peris
25. hable.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
uh.edu.cis2348
Interface PerishableAll Known Implementing
Classes:FoodItempublic interface Perishable
Methods to be implemented by items that are perishable
Method Summary
All Methods Instance MethodsAbstract MethodsModifier and
TypeMethod and Descriptionjava.util.DategetExpiredDate()
This function returns the expiration date of the product based on
its shelf life and the day that it was added to inventory
intgetShelfLife()
26. Returns the number of days that a product can remain on the
shelves before being thrown out
Method DetailgetShelfLifeint getShelfLife()
Returns the number of days that a product can remain on the
shelves before being thrown out
Returns:the shelf life in
daysgetExpiredDatejava.util.Date getExpiredDate()
This function returns the expiration date of the product based on
its shelf life and the day that it was added to inventory
Returns:Date objectSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/Householditems/Householditems/Householditems/Shipp
able.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
27. uh.edu.cis2348
Interface ShippableAll Known Implementing
Classes:HouseholdItempublic interface Shippable
Interface for items that can be shipped
Method Summary
All Methods Instance MethodsAbstract MethodsModifier and
TypeMethod and
DescriptiondoublecalculateShippingCost(java.lang.String shipD
ateString) Method
DetailcalculateShippingCostdouble calculateShippingCost(java.l
ang.String shipDateString)
throws
java.text.ParseExceptionThrows:java.text.ParseExceptionSkip
navigation
linksPackageClassTreeDeprecatedIndexHelpPrev ClassNext Cla
ssFramesNo FramesAll ClassesSummary: Nested | Field | Constr
| MethodDetail: Field | Constr | Method
javadoc/index.html
javadoc/index-files/index-1.html
JavaScript is disabled on your browser.
28. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
CcalculateShippingCost(String) - Method in class
uh.edu.cis2348.HouseholdItem
Calculates the shipping cost of the item based on its weight
and whether it was shipped on a Saturday or Sunday.
calculateShippingCost(String) - Method in interface
uh.edu.cis2348.ShippableCEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-10.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
SshipAllHouseholdItems(String) - Method in class
uh.edu.cis2348.InventoryManager
This function finds all the household inventory items in the
inventory.
29. Shippable - Interface in uh.edu.cis2348
Interface for items that can be shipped
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-11.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
TtoString() - Method in class
uh.edu.cis2348.FoodItemtoString() - Method in class
uh.edu.cis2348.HouseholdItemtoString() - Method in class
uh.edu.cis2348.InventoryItemCEFGHILMPSTU_Skip
navigation linksPackageClassTreeDeprecatedIndexHelpPrev
LetterNext LetterFramesNo FramesAll Classes
javadoc/index-files/index-12.html
JavaScript is disabled on your browser.
30. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
Uuh.edu.cis2348 - package
uh.edu.cis2348CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-13.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
__calories - Variable in class
uh.edu.cis2348.FoodItem_inventory - Variable in class
uh.edu.cis2348.InventoryManager
the list of all items in inventory
_name - Variable in class
uh.edu.cis2348.InventoryItem_shelfLife - Variable in class
uh.edu.cis2348.FoodItem_stockedDate - Variable in class
uh.edu.cis2348.FoodItem_unusableDate - Variable in class
uh.edu.cis2348.FoodItem_weight - Variable in class
uh.edu.cis2348.HouseholdItem
the weight of the item, used in calculating the shipping cost
CEFGHILMPSTU_Skip navigation
31. linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-2.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
EEdible - Interface in uh.edu.cis2348
Interface for items that are edible
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-3.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
32. FFoodItem - Class in uh.edu.cis2348
Encapsulates food items
FoodItem(String, int, double) - Constructor for class
uh.edu.cis2348.FoodItem
Create a new food item
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-4.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
GgetCalories() - Method in interface
uh.edu.cis2348.EdiblegetCalories() - Method in class
uh.edu.cis2348.FoodItem
Returns the calories in the food item
getExpiredDate() - Method in class
uh.edu.cis2348.FoodItemgetExpiredDate() - Method in interface
uh.edu.cis2348.Perishable
This function returns the expiration date of the product based on
its shelf life and the day that it was added to inventory
getName() - Method in class
33. uh.edu.cis2348.InventoryItemgetShelfLife() - Method in class
uh.edu.cis2348.FoodItemgetShelfLife() - Method in interface
uh.edu.cis2348.Perishable
Returns the number of days that a product can remain on the
shelves before being thrown out
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-5.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
HHouseholdItem - Class in uh.edu.cis2348
Encapsulates durable items for the house, such as toasters and
dryers
HouseholdItem(String, int) - Constructor for class
uh.edu.cis2348.HouseholdItem
Constructor
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-6.html
34. JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
IInventoryItem - Class in uh.edu.cis2348
Abstract class that is the base of all inventory items
InventoryItem(String) - Constructor for class
uh.edu.cis2348.InventoryItem
Constructs a new inventory item
InventoryManager - Class in uh.edu.cis2348
The main class for the inventory management system
InventoryManager() - Constructor for class
uh.edu.cis2348.InventoryManagerisWeekend(Date) - Method in
class uh.edu.cis2348.HouseholdItem
Determines if the given date is on a weekend.
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-7.html
JavaScript is disabled on your browser.
35. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
LloadInventory(String) - Method in class
uh.edu.cis2348.InventoryManager
Reads in the inventory file, storing the contents in the
_inventory list.
loadInventory() - Method in class
uh.edu.cis2348.InventoryManager
Loads inventory from the database
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-8.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
Mmain(String[]) - Static method in class
uh.edu.cis2348.InventoryManager
36. This is the entry point for the application.
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/index-files/index-9.html
JavaScript is disabled on your browser.
Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll ClassesCEFGHILMPSTU_
PPerishable - Interface in uh.edu.cis2348
Methods to be implemented by items that are perishable
printInventory() - Method in class
uh.edu.cis2348.InventoryManager
Prints the inventory to the console
CEFGHILMPSTU_Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrev LetterNext
LetterFramesNo FramesAll Classes
javadoc/overview-tree.html
JavaScript is disabled on your browser.
37. Skip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll ClassesHierarchy For All Packages
Package Hierarchies:
uh.edu.cis2348
Class Hierarchyjava.lang.Object
uh.edu.cis2348.InventoryItemuh.edu.cis2348.FoodItem
(implements uh.edu.cis2348.Edible,
uh.edu.cis2348.Perishable)uh.edu.cis2348.HouseholdItem
(implements
uh.edu.cis2348.Shippable)uh.edu.cis2348.InventoryManager
Interface
Hierarchyuh.edu.cis2348.Edibleuh.edu.cis2348.Perishableuh.ed
u.cis2348.ShippableSkip navigation
linksPackageClassTreeDeprecatedIndexHelpPrevNextFramesNo
FramesAll Classes
javadoc/package-list
uh.edu.cis2348
javadoc/script.js
function show(type)
{
count = 0;
for (var key in methods) {
var row = document.getElementById(key);
if ((methods[key] & type) != 0) {
row.style.display = '';
38. row.className = (count++ % 2) ? rowColor : altColor;
}
else
row.style.display = 'none';
}
updateTabs(type);
}
function updateTabs(type)
{
for (var value in tabs) {
var sNode = document.getElementById(tabs[value][0]);
var spanNode = sNode.firstChild;
if (value == type) {
sNode.className = activeTableTab;
spanNode.innerHTML = tabs[value][1];
}
else {
sNode.className = tableTab;
spanNode.innerHTML = "<a href="javascript:show("+
value + ");">" + tabs[value][1] + "</a>";
}
}
}
javadoc/stylesheet.css
/* Javadoc style sheet */
/*
Overall document style
*/
@import url('resources/fonts/dejavu.css');
body {
background-color:#ffffff;