Class Item

  • Direct Known Subclasses:
    Book, CD

    public abstract class Item
    extends java.lang.Object

    Item

    Abstract class responsible for handling all the different types of items.
    Since:
    2017-07-17
    Version:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      Item()  
      Item​(java.lang.String aTitle, double aPrice, int id)  
    • Method Summary

      Modifier and Type Method Description
      abstract java.lang.String getDetails()  
      abstract double getFinalPrice()  
      int getId()  
      double getOriginalPrice()  
      java.lang.String getTitle()  
      abstract java.lang.String showDetails()
      Shows the information for an item
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Item

        public Item()
      • Item

        public Item​(java.lang.String aTitle,
                    double aPrice,
                    int id)
    • Method Detail

      • showDetails

        public abstract java.lang.String showDetails()
        Shows the information for an item
      • getDetails

        public abstract java.lang.String getDetails()
        Returns:
        the information for an item
      • getFinalPrice

        public abstract double getFinalPrice()
        Returns:
        the price after discount of a selected item
      • getTitle

        public java.lang.String getTitle()
        Returns:
        the title of an item
      • getId

        public int getId()
        Returns:
        the id of an item
      • getOriginalPrice

        public double getOriginalPrice()
        Returns:
        the original price of a selected item