Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getID()
      Grabs the object's ID
      java.lang.String getItemCode()
      Gets the itemCode of the product object
      java.lang.String getManufacturer()
      Grabs the name of the manufacturer of the product object
      java.lang.String getName()
      Grabs the object's name
      ItemType getType()
      Grabs the current ItemType of
      void setID​(int id)
      Sets the ID of the product object
      void setManufacturer​(java.lang.String manufacturer)
      Sets the manufacturer of the product class
      void setName​(java.lang.String name)
      Sets the name of the product object
      void setType​(ItemType type)
      Sets the ItemType of a product object
      java.lang.String toString()
      Takes the name, manufacturer, and type and outputs it as a string
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 product
        manufacturer - 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:
        toString in class java.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
        Specified by:
        getID in interface Item
        Returns:
        The object's ID
      • setName

        public void setName​(java.lang.String name)
        Sets the name of the product object
        Specified by:
        setName in interface Item
        Parameters:
        name - The new name
      • getName

        public java.lang.String getName()
        Grabs the object's name
        Specified by:
        getName in interface Item
        Returns:
        The object's name
      • setManufacturer

        public void setManufacturer​(java.lang.String manufacturer)
        Sets the manufacturer of the product class
        Specified by:
        setManufacturer in interface Item
        Parameters:
        manufacturer - The new manufacturer
      • getManufacturer

        public java.lang.String getManufacturer()
        Grabs the name of the manufacturer of the product object
        Specified by:
        getManufacturer in interface Item
        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