FileDocCategorySizeDatePackage
ItemKey.javaAPI DocExample534Mon Nov 24 22:05:06 GMT 2003com.oreilly.patterns.chapter9

ItemKey.java

package com.oreilly.patterns.chapter9;

import java.io.Serializable;

public final class ItemKey implements Serializable {
    
    public int itemNumber;
    
    public boolean equals(Object otherOb) {
        
        if (this == otherOb) {
            return true;
        }
        if (!(otherOb instanceof ItemKey)) {
            return false;
        }

        ItemKey other = (ItemKey) otherOb;
        
	return (itemNumber == other.itemNumber);
    }
    
    public int hashCode() {
        return itemNumber;
    }    
}