Class Product
java.lang.Object
com.xavierloeraflores.inventorymanagement.Product
A class representing products in
which may or may not have associated parts
- Author:
- xavierloeraflores
-
Field Summary
Modifier and TypeFieldDescriptionprivate 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssociatedPart
(Part part) 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
getId()
Returns the id number of the product.int
getMax()
Returns the maximum order quantity of the product.int
getMin()
Returns the minimum order quantity of the product.getName()
Returns the name of the product.double
getPrice()
Returns the cost price of the product.int
getStock()
Returns the total remaining stock of the product.void
setId
(int id) Sets the product id number for this productvoid
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.
-
Field Details
-
associatedParts
The [observableArrayList] of parts associated with this product. -
id
private int idThe [int] value id identifying this product. -
name
The [String] value name of this product. -
price
private double priceThe [double] value name of this product. -
stock
private int stockThe [int] value stock representing the total stock left of this product. -
min
private int minThe [int] value min representing the minimum order quantity of this product. -
max
private int maxThe [int] value max representing the maximum order quantity of this product.
-
-
Constructor Details
-
Product
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
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
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
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
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
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.
-