Class Product
- java.lang.Object
-
- Product
-
- All Implemented Interfaces:
Item
- Direct Known Subclasses:
AudioPlayer,MoviePlayer
public abstract class Product extends java.lang.Object implements Item
The main class for the GUI, it holds every component and all interactions the user can do.- Author:
- Jairo Garciga
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetID()Grabs the object's IDjava.lang.StringgetItemCode()Gets the itemCode of the product objectjava.lang.StringgetManufacturer()Grabs the name of the manufacturer of the product objectjava.lang.StringgetName()Grabs the object's nameItemTypegetType()Grabs the current ItemType ofvoidsetID(int id)Sets the ID of the product objectvoidsetManufacturer(java.lang.String manufacturer)Sets the manufacturer of the product classvoidsetName(java.lang.String name)Sets the name of the product objectvoidsetType(ItemType type)Sets the ItemType of a product objectjava.lang.StringtoString()Takes the name, manufacturer, and type and outputs it as a string
-
-
-
Constructor Detail
-
Product
public Product(java.lang.String name, java.lang.String manufacturer, ItemType item)The Product Class creates product objects which are stored in a database and used in the tableView. They are also used in the list view on the listView.- Parameters:
name- The name of the productmanufacturer- The name of the manufacturer of the product (Must be 3 letters at least)item- The ItemType of the object
-
-
Method Detail
-
toString
public java.lang.String toString()
Takes the name, manufacturer, and type and outputs it as a string- Overrides:
toStringin classjava.lang.Object- Returns:
- The string output of a product object
-
setID
public void setID(int id)
Sets the ID of the product object- Parameters:
id- The new id
-
getID
public int getID()
Grabs the object's ID
-
setName
public void setName(java.lang.String name)
Sets the name of the product object
-
getName
public java.lang.String getName()
Grabs the object's name
-
setManufacturer
public void setManufacturer(java.lang.String manufacturer)
Sets the manufacturer of the product class- Specified by:
setManufacturerin interfaceItem- Parameters:
manufacturer- The new manufacturer
-
getManufacturer
public java.lang.String getManufacturer()
Grabs the name of the manufacturer of the product object- Specified by:
getManufacturerin interfaceItem- Returns:
- The name of the manufacturer
-
setType
public void setType(ItemType type)
Sets the ItemType of a product object- Parameters:
type- The new ItemType
-
getType
public ItemType getType()
Grabs the current ItemType of- Returns:
- The current ItemType
-
getItemCode
public java.lang.String getItemCode()
Gets the itemCode of the product object- Returns:
- The current itemCode
-
-