testentity.java

来自「嵌入式数据库Berkeley DB-4.5.20源代码」· Java 代码 · 共 46 行

JAVA
46
字号
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2002-2006 *	Oracle Corporation.  All rights reserved. * * $Id: TestEntity.java,v 12.3 2006/08/24 14:46:46 bostic Exp $ */package com.sleepycat.collections.test;/** * @author Mark Hayes */class TestEntity {    int key;    int value;    TestEntity(int key, int value) {        this.key = key;        this.value = value;    }    public boolean equals(Object o) {        try {            TestEntity e = (TestEntity) o;            return e.key == key && e.value == value;        } catch (ClassCastException e) {            return false;        }    }    public int hashCode() {        return key;    }    public String toString() {        return "[key " + key + " value " + value + ']';    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?