我自己做班级方法{ string class name,方法名称; VectorparameterTypes; }然后,以Method为键值,写了地图。 然后,我可以在遍历所有输出此映射的密钥时输出我想要的一对.
我自己做班级方法{ string class name,方法名称; 矢量参数类型; }然后,以Method为键值,写了地图。 然后,当我遍历所有用于输出此映射的密钥时,我可以输出我想要的对象a的内容,但写Map.containsKey(a )将返回false。 我自己尝试过重写Object.equals方法,但还是没有用。 改写的equals方法如下。 公共蓝牙(对象以太网) if (! (方法实例)返回假; 方法通告程序=(方法)通告程序方法; if (! this.class name.equals (another.class name ) ) return false; if (! this.method name.equals (another.method name ) ) return false; if (this.parameter types==null another.parameter types!=null (返回假; if(this.Parametertypes!=null another.parameter types==null ) return false; if(this.parametertypes.size (!=another.parameterTypes.size () ) return false; for(intI=0; I
展开