FileDocCategorySizeDatePackage
ReservationPK.javaAPI DocExample695Thu Apr 20 15:53:50 BST 2000com.titan.reservation

ReservationPK.java

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 int hashCode( ){
       return toString().hashCode();
    }
    
    public boolean equals(Object obj){
         if(obj instanceof ReservationPK)
             return (((ReservationPK)obj).cruiseID == cruiseID && ((ReservationPK)obj).cabinID == cabinID);
         
         return false;
    }
    
    public String toString( ){
        return cruiseID+""+cabinID;
    }
    
}