📄 methodkey.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Core License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: MethodKey.java,v 1.5 2003/11/01 18:34:36 ohlrogge Exp $package org.ozoneDB.core;import org.ozoneDB.DxLib.DxCompatible;import org.ozoneDB.DxLib.DxObject;import java.lang.reflect.Method;/** * Objects of this class are the keys in the method cache table of the * {@link AbstractObjectContainer}. This class implements the way we map from * class+methodName+sig to the actual method. This is very important for the * overall peformance of ozone. Besides this class is used to sort method * arrays. * * * @author <a href="http://www.softwarebuero.de/">SMB</a> * @version $Revision: 1.5 $Date: 2003/11/01 18:34:36 $ */public final class MethodKey implements Comparable{ protected String methodName; protected String sig; protected String className; protected Method method; public MethodKey( String _className, String _methodName, String _sig ) { this( _className, _methodName, _sig, null ); } public MethodKey( String _className, String _methodName, String _sig, Method _method ) { className = _className; methodName = _methodName; sig = _sig; method = _method; } public Method method() { return method; } public int hashCode() { return methodName.hashCode() ^ sig.hashCode(); } public boolean equals( Object obj ) { MethodKey rhs = (MethodKey)obj; return className.equals( rhs.className ) && sig.equals( rhs.sig ) && methodName.equals( rhs.methodName ); } public String toString() { return className + "." + methodName + "(" + sig + ")"; } public int compareTo(Object o) { MethodKey rhs = (MethodKey) o; // this method is just used to sort a method array, so it doesn't // need to be that fast... StringBuffer buf = new StringBuffer( className ); buf.append( methodName ); buf.append( sig ); StringBuffer rhsBuf = new StringBuffer( rhs.className ); rhsBuf.append( rhs.methodName ); rhsBuf.append( rhs.sig ); return buf.toString().compareTo(rhsBuf.toString()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -