java.lang.Object | +--Product
A simple helper class for the course T-106.233 assignment 2 (GUI). This class is specifically for the purposes of the assignment and is not meant to serve any greater good.
| Constructor Summary | |
Product()
Constructs a new Product and initializes it's name, size, color, price, amount available and supplier by making up some values. |
|
| Method Summary | |
java.lang.String |
getAmountAvailable()
|
java.lang.String |
getPrice()
|
java.lang.String |
getPriceWithEuroSign()
|
java.lang.String |
getProductInfo()
|
java.lang.String |
getSupplier()
Use this if you use a JTextField instead of a JComboBox for changing the supplier. |
int |
getSupplierIndex()
This method is intended for use with the JComboBox in the part 3 of the assignment. |
java.util.Vector |
getSuppliers()
This method is intended for use with the JComboBox in the part 3 of the assignment. |
void |
setAmountAvailable(java.lang.String newAmountAvailable)
Sets a new amount available for this Product |
void |
setPrice(java.lang.String newPrice)
Sets a new price for this Product. |
void |
setSupplier(int newIndex)
Sets a new supplier for this Product. |
void |
setSupplier(java.lang.String newSupplier)
Sets a new supplier for this Product. |
java.lang.String |
toString()
This method takes care of the String representation of this Product in a JList. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Product()
| Method Detail |
public java.lang.String getAmountAvailable()
public java.lang.String getPrice()
public java.lang.String getPriceWithEuroSign()
public java.lang.String getProductInfo()
public java.lang.String getSupplier()
public int getSupplierIndex()
public java.util.Vector getSuppliers()
public void setAmountAvailable(java.lang.String newAmountAvailable)
newAmountAvailable - the new amount available that you propably got
from a JTextField.public void setPrice(java.lang.String newPrice)
newPrice - the new price that you propably got from a JTextField.public void setSupplier(int newIndex)
newIndex - the new index that is supposed to come from the selection
in a JComboBox.public void setSupplier(java.lang.String newSupplier)
newSupplier - the name of the new supplier.public java.lang.String toString()
toString in class java.lang.Object