📄 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-2000 by SMB GmbH. All rights reserved.//// $Id: MethodKey.java,v 1.4 2000/10/28 16:55:16 daniela Exp $package org.ozoneDB.core;import java.io.*;import java.util.*;import java.lang.reflect.*;import org.ozoneDB.*;import org.ozoneDB.tools.OPP.*;import org.ozoneDB.DxLib.*;import org.ozoneDB.core.*;import org.ozoneDB.util.*;/** * 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.4 $Date: 2000/10/28 16:55:16 $ */public final class MethodKey extends DxObject { 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 boolean isLess( DxCompatible obj ) { MethodKey rhs = (MethodKey)obj; // 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() ) < 0; } public String toString() { return className + "." + methodName + "(" + sig + ")"; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -