/** * Test for equality. * True, if both objects are equal. */ public boolean equals(Object obj) { if(this==obj) return true; boolean ret = obj!=null && hashcode==obj.hashCode() && obj instanceof Tuple; if(ret) { Tuple tuple1 = this; Tuple tuple2 = (Tuple)obj; // ret = Srules.equals(this.last, tuple2.last) // && Srules.equals(this.object, tuple2.object); ret = tuple1.size==tuple2.size; while(ret && tuple1!=null) { ret = state.equals(tuple1.object, tuple2.object); tuple1 = tuple1.last; tuple2 = tuple2.last; } } return ret; }
/** * Test for equality. * True, if both objects are equal. */ public boolean equals(Object obj) { if(this==obj) return true; boolean ret = obj!=null && hashcode==obj.hashCode() && obj instanceof Tuple; if(ret) { Tuple tuple1 = this; Tuple tuple2 = (Tuple)obj; // ret = Srules.equals(this.last, tuple2.last) // && Srules.equals(this.object, tuple2.object); ret = tuple1.size==tuple2.size; while(ret && tuple1!=null) { ret = state.equals(tuple1.object, tuple2.object); tuple1 = tuple1.last; tuple2 = tuple2.last; } } return ret; }
/** * Check if an object is contained in a collection. * Avoid the need for an "IdentityArrayList". */ protected boolean contains(IOAVState state, Collection coll, Object o) { boolean ret = false; for(Iterator it=coll.iterator(); !ret && it.hasNext(); ) { Object val = it.next(); if(val instanceof ArrayList && o instanceof ArrayList) { ArrayList l1 = (ArrayList) val; ArrayList l2 = (ArrayList) o; if(l1.size()==l2.size()) { ret = true; for(int i=0; ret && i<l1.size(); i++) ret = state.equals(l1.get(i), l2.get(i)); } } else { ret = state.equals(val, o); } } return ret; } }
/** * Check if an object is contained in a collection. * Avoid the need for an "IdentityArrayList". */ protected boolean contains(IOAVState state, Collection coll, Object o) { boolean ret = false; for(Iterator it=coll.iterator(); !ret && it.hasNext(); ) { Object val = it.next(); if(val instanceof ArrayList && o instanceof ArrayList) { ArrayList l1 = (ArrayList) val; ArrayList l2 = (ArrayList) o; if(l1.size()==l2.size()) { ret = true; for(int i=0; ret && i<l1.size(); i++) ret = state.equals(l1.get(i), l2.get(i)); } } else { ret = state.equals(val, o); } } return ret; } }
if(state.equals(id, evt.id) && SUtil.equals(type, evt.type) && SUtil.equals(attribute, evt.attribute)
if(state.equals(id, evt.id) && SUtil.equals(type, evt.type) && SUtil.equals(attribute, evt.attribute)