126 lines
2.3 KiB
Java
126 lines
2.3 KiB
Java
|
|
/**
|
|
* A class to track and allow for reservations in a Library
|
|
*
|
|
* @George Wilkinson
|
|
* @1.0
|
|
*/
|
|
|
|
import java.util.Date;
|
|
|
|
public class LibraryReservation
|
|
{
|
|
// instance variables
|
|
private String reservationNo;
|
|
private String itemCode;
|
|
private String userID;
|
|
private Date startDate;
|
|
private int noOfDays;
|
|
|
|
/**
|
|
* Constructor for objects of class LibraryReservation
|
|
*/
|
|
public LibraryReservation( String reservationNo, String itemCode, String userID, String startDate, int noOfDays )
|
|
{
|
|
this.reservationNo = reservationNo;
|
|
this.itemCode = itemCode;
|
|
this.userID = userID;
|
|
this.startDate = DateUtil.convertStringToDate( startDate );
|
|
this.noOfDays = noOfDays;
|
|
}
|
|
|
|
/*
|
|
* Start Accessor
|
|
*/
|
|
|
|
/*
|
|
* Return value of @reservationNo
|
|
*/
|
|
public String getReservationNo()
|
|
{
|
|
return reservationNo;
|
|
}
|
|
|
|
/*
|
|
* Return value of @itemCode
|
|
*/
|
|
public String getItemCode()
|
|
{
|
|
return itemCode;
|
|
}
|
|
|
|
/*
|
|
* Return value of @userID
|
|
*/
|
|
public String getUserID()
|
|
{
|
|
return userID;
|
|
}
|
|
|
|
/*
|
|
* Return value of @startDate
|
|
*/
|
|
public Date getStartDate()
|
|
{
|
|
return startDate;
|
|
}
|
|
|
|
/*
|
|
* Return value of @noOfDays
|
|
*/
|
|
public int getNoOfDays()
|
|
{
|
|
return noOfDays;
|
|
}
|
|
|
|
/*
|
|
* End Accessor
|
|
*
|
|
* Start Mutator
|
|
*/
|
|
|
|
/*
|
|
* Set @reservationNo to a new value
|
|
*/
|
|
public void setReservationNo( String reservationNo )
|
|
{
|
|
this.reservationNo = reservationNo;
|
|
}
|
|
|
|
/*
|
|
* Set @itemCode to a new value
|
|
*/
|
|
public void setItemCode( String itemCode )
|
|
{
|
|
this.itemCode = itemCode;
|
|
}
|
|
|
|
/*
|
|
* Set @userID to a new value
|
|
*/
|
|
public void setUserID( String userID )
|
|
{
|
|
this.userID = userID;
|
|
}
|
|
|
|
/*
|
|
* Set @startDate to a new value
|
|
*/
|
|
public void setStartDate( String startDate )
|
|
{
|
|
this.startDate = DateUtil.convertStringToDate( startDate );
|
|
}
|
|
|
|
/*
|
|
* Set @noOfDays to a new value
|
|
*/
|
|
public void setNoOfDays( int noOfDays )
|
|
{
|
|
this.noOfDays = noOfDays;
|
|
}
|
|
|
|
/*
|
|
* End Mutator
|
|
*/
|
|
}
|