FileDocCategorySizeDatePackage
Rental.javaAPI DocExample1080Thu Dec 26 11:01:36 GMT 2002com.mediamania.store

Rental

public class Rental extends Transaction

Fields Summary
private RentalItem
rentalItem
private RentalCode
rentalCode
private Date
returnDate
private Date
actualReturnDate
Constructors Summary
private Rental()

 
public Rental(Customer cust, Date date, RentalItem item)

        super(cust, date);
        rentalItem = item;
        item.setCurrentRental(this);
        rentalCode = item.getMediaItem().getRentalCode();
        setPrice(rentalCode.getCost());
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(date);
        cal.add(Calendar.DATE, rentalCode.getNumberOfDays());
        returnDate = cal.getTime();
        actualReturnDate = null;
    
Methods Summary
public MediaItemgetMediaItem()

        return rentalItem.getMediaItem();
    
public RentalItemgetRentalItem()

        return rentalItem;
    
public voidsetDateReturned(java.util.Date d)

        actualReturnDate = d;