public class Fresh extends Item implements java.io.Serializable
Constructor and Description |
---|
Fresh(java.lang.String number,
java.lang.String name,
double price,
java.util.Date expiry)
Construct a fresh inventory item with the given number, name,
selling price per unit, and expiry date, and a zero opening stock quantity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Test the equality of items.
|
java.util.Date |
getExpiry()
Determine the expiry date of
this Item. |
java.lang.String |
toString()
Construct a string representation of
this item. |
compareTo, getName, getNumber, getPurchasedQty, getPurchases, getSales, getSoldQty, getStock, getUnitCost, getUnitPrice, hashCode, purchase, sell, sell, setUnitPrice
public Fresh(java.lang.String number, java.lang.String name, double price, java.util.Date expiry)
number
- the item number.name
- the name of the item.price
- the selling price per unit of the item.expiry
- the date on which the item will expire.java.lang.RuntimeException
- if any of the passed parameters is null.public java.util.Date getExpiry()
this
Item.this
item.public java.lang.String toString()
this
item.public boolean equals(java.lang.Object other)
this
item if
it is a Fresh
object with the same number and
expiry date as this
one.