FileDocCategorySizeDatePackage
SalesRecordKey.javaAPI DocExample655Mon Nov 24 22:05:08 GMT 2003com.oreilly.patterns.chapter9

SalesRecordKey.java

package com.oreilly.patterns.chapter9;

import java.io.Serializable;

public final class SalesRecordKey implements Serializable {
    
    public int saleId;
    
    public SalesRecordKey() {}
    public SalesRecordKey(int saleId) {
        this.saleId = saleId;
    }
    
    public boolean equals(Object otherOb) {
        
        if (this == otherOb) {
            return true;
        }
        if (!(otherOb instanceof SalesRecordKey)) {
            return false;
        }
        SalesRecordKey other = (SalesRecordKey) otherOb;
        return (saleId == other.saleId);
    }
    
    public int hashCode() {
        return saleId
    }
    
}