01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: TestEntity.java,v 1.13.2.2 2008/01/07 15:14:24 cwl Exp $
07: */
08:
09: package com.sleepycat.collections.test;
10:
11: /**
12: * @author Mark Hayes
13: */
14: class TestEntity {
15:
16: int key;
17: int value;
18:
19: TestEntity(int key, int value) {
20:
21: this .key = key;
22: this .value = value;
23: }
24:
25: public boolean equals(Object o) {
26:
27: try {
28: TestEntity e = (TestEntity) o;
29: return e.key == key && e.value == value;
30: } catch (ClassCastException e) {
31: return false;
32: }
33: }
34:
35: public int hashCode() {
36:
37: return key;
38: }
39:
40: public String toString() {
41:
42: return "[key " + key + " value " + value + ']';
43: }
44: }
|