Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

TestEntity.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: TestEntity.java,v 12.1 2005/01/31 19:27:35 mark Exp $
00008  */
00009 
00010 package com.sleepycat.collections.test;
00011 
00015 class TestEntity {
00016 
00017     int key;
00018     int value;
00019 
00020     TestEntity(int key, int value) {
00021 
00022         this.key = key;
00023         this.value = value;
00024     }
00025 
00026     public boolean equals(Object o) {
00027 
00028         try {
00029             TestEntity e = (TestEntity) o;
00030             return e.key == key && e.value == value;
00031         } catch (ClassCastException e) {
00032             return false;
00033         }
00034     }
00035 
00036     public int hashCode() {
00037 
00038         return key;
00039     }
00040 
00041     public String toString() {
00042 
00043         return "[key " + key + " value " + value + ']';
00044     }
00045 }

Generated on Sun Dec 25 12:14:55 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2