package com.titan.reservation;
public class ReservationPK implements java.io.Serializable {
public int cruiseID;
public int cabinID;
public ReservationPK(){}
public ReservationPK(int crsID, int cbnID){
cruiseID = crsID;
cabinID = cbnID;
}
public boolean equals(Object obj){
if(!(obj instanceof ReservationPK))
return false;
else if(((ReservationPK)obj).cruiseID == cruiseID && ((ReservationPK)obj).cabinID == cabinID)
return true;
else
return false;
}
public int hashCode( ){
return toString().hashCode();
}
public String toString( ){
return cruiseID+""+cabinID;
}
}
|