videoautomat
Class VideoCassette
java.lang.Object
|
+--data.AbstractNameable
|
+--data.ooimpl.StockItemImpl
|
+--videoautomat.VideoCassette
- All Implemented Interfaces:
- Cloneable, Comparable, data.DataBasketKeys, data.Nameable, Serializable, data.StockItem
- public class VideoCassette
- extends data.ooimpl.StockItemImpl
This class implements a StockItem, representing a rented video, including the Date
when it was rented
- See Also:
- Serialized Form
Fields inherited from class data.AbstractNameable |
m_ncContext, m_pcsPropertyListeners |
Fields inherited from interface data.Nameable |
NAME_PROPERTY |
Fields inherited from interface data.DataBasketKeys |
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary |
VideoCassette(String key)
Constructs a new VideoCassette with the given name and the current time as renting time |
Methods inherited from class data.ooimpl.StockItemImpl |
clone, compareTo, equals, getAssociatedItem, getShallowClone, getStock, setStock, toString |
Methods inherited from class data.AbstractNameable |
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from interface data.Nameable |
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
VideoCassette
public VideoCassette(String key)
- Constructs a new VideoCassette with the given name and the current time as renting time
- Parameters:
key
- the name of the video
getDays
public int getDays()
- Returns:
- the days this video is already rented, in the case of 0 days it returns 1.
getCost
public data.NumberValue getCost()
- Returns:
- the cost for this video from the day of renting to the current
Date