java.lang.Object
com.xavierloeraflores.inventorymanagement.Product

public class Product extends Object
A class representing products in which may or may not have associated parts
Author:
xavierloeraflores
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.collections.ObservableList<Part>
    The [observableArrayList] of parts associated with this product.
    private int
    The [int] value id identifying this product.
    private int
    The [int] value max representing the maximum order quantity of this product.
    private int
    The [int] value min representing the minimum order quantity of this product.
    private String
    The [String] value name of this product.
    private double
    The [double] value name of this product.
    private int
    The [int] value stock representing the total stock left of this product.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Product(int id, String name, double price, int stock, int min, int max)
    Constructor initializing this.id to id, this.name to name, this.price to price, this.stock to stock, this.min to min, this.max to max
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a part to the associatedParts list of the product.
    boolean
    deleteAssociatedPart(Part selectedAssociatedPart)
    Deletes a part from the associatedParts list of the product.
    javafx.collections.ObservableList<Part>
    Returns the associated parts list of the product.
    int
    Returns the id number of the product.
    int
    Returns the maximum order quantity of the product.
    int
    Returns the minimum order quantity of the product.
    Returns the name of the product.
    double
    Returns the cost price of the product.
    int
    Returns the total remaining stock of the product.
    void
    setId(int id)
    Sets the product id number for this product
    void
    setMax(int max)
    Sets the maximum order quantity of the product.
    void
    setMin(int min)
    Sets the minimum order quantity of the product.
    void
    Sets the product name for this product.
    void
    setPrice(double price)
    Sets the price cost of the product.
    void
    setStock(int stock)
    Sets the total amount of stock left for this product.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • associatedParts

      private javafx.collections.ObservableList<Part> associatedParts
      The [observableArrayList] of parts associated with this product.
    • id

      private int id
      The [int] value id identifying this product.
    • name

      private String name
      The [String] value name of this product.
    • price

      private double price
      The [double] value name of this product.
    • stock

      private int stock
      The [int] value stock representing the total stock left of this product.
    • min

      private int min
      The [int] value min representing the minimum order quantity of this product.
    • max

      private int max
      The [int] value max representing the maximum order quantity of this product.
  • Constructor Details

    • Product

      public Product(int id, String name, double price, int stock, int min, int max)
      Constructor initializing this.id to id, this.name to name, this.price to price, this.stock to stock, this.min to min, this.max to max
      Parameters:
      id - The [int] value id identifying this product.
      name - The [String] value name of this product.
      price - The [double] value name of this product.
      stock - The [int] value stock representing the total stock left of this product.
      min - The [int] value min representing the minimum order quantity of this product.
      max - The [int] value max representing the maximum order quantity of this product.
  • Method Details

    • getAllAssociatedParts

      public javafx.collections.ObservableList<Part> getAllAssociatedParts()
      Returns the associated parts list of the product.
      Returns:
      [ObservableList] value associated parts of this product.
    • getId

      public int getId()
      Returns the id number of the product.
      Returns:
      [int] value id of this product.
    • getName

      public String getName()
      Returns the name of the product.
      Returns:
      [String] value name of this product.
    • getPrice

      public double getPrice()
      Returns the cost price of the product.
      Returns:
      [double] value price of this product.
    • getStock

      public int getStock()
      Returns the total remaining stock of the product.
      Returns:
      [int] value stock of this product.
    • getMin

      public int getMin()
      Returns the minimum order quantity of the product.
      Returns:
      [int] value min of this product.
    • getMax

      public int getMax()
      Returns the maximum order quantity of the product.
      Returns:
      [int] value max of this product.
    • setId

      public void setId(int id)
      Sets the product id number for this product
      Parameters:
      id - The [int] value id of this product.
    • setName

      public void setName(String name)
      Sets the product name for this product.
      Parameters:
      name - The [String] value name of this product.
    • setPrice

      public void setPrice(double price)
      Sets the price cost of the product.
      Parameters:
      price - The [double] value name of this product.
    • setStock

      public void setStock(int stock)
      Sets the total amount of stock left for this product.
      Parameters:
      stock - The [int] value stock representing the total stock left of this product.
    • setMin

      public void setMin(int min)
      Sets the minimum order quantity of the product.
      Parameters:
      min - The [int] value min representing the minimum order quantity of this product.
    • setMax

      public void setMax(int max)
      Sets the maximum order quantity of the product.
      Parameters:
      max - The [int] value max representing the maximum order quantity of this product.
    • addAssociatedPart

      public void addAssociatedPart(Part part)
      Adds a part to the associatedParts list of the product.
      Parameters:
      part - The [Part] object part to be added to the associatedParts of this product.
    • deleteAssociatedPart

      public boolean deleteAssociatedPart(Part selectedAssociatedPart)
      Deletes a part from the associatedParts list of the product.
      Parameters:
      selectedAssociatedPart - The [Part] object part to be deleted to the associatedParts of this product.
      Returns:
      A [boolean] value: true if the part was successfully deleted or false if no part was deleted.