videoautomat
Class VideoCassette
java.lang.Object
StockItemImpl
videoautomat.VideoCassette
public class VideoCassette
- extends StockItemImpl
This class implements a StockItem, representing a rented video, including the Date
when it was rented
Constructor Summary |
VideoCassette(String key)
Constructs a new VideoCassette with the given name and the current time as renting time |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 NumberValue getCost()
- Returns:
- the cost for this video from the day of renting to the current
Date