- Timestamp:
- 01/30/12 15:40:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java
r336 r373 97 97 Event<?> otherEvent = (Event<?>) other; 98 98 if (otherEvent.canEqual(this)) { 99 if (type != null && target != null) {99 if (type != null) { 100 100 return type.equals(otherEvent.type) 101 && target.equals(otherEvent.target); 102 } else if (type != null && target == null) { 103 return type.equals(otherEvent.type) 104 && otherEvent.target == null; 105 } else if (type == null && target != null) { 101 && targetEquals(otherEvent.target); 102 } else { 106 103 return otherEvent.type == null 107 && target.equals(otherEvent.target); 108 } else { 109 return otherEvent.type == null && otherEvent.target == null; 104 && targetEquals(otherEvent.target); 110 105 } 111 106 } else { … … 287 282 return true; 288 283 } 284 285 /** 286 * <p> 287 * This function is used by {@link #equals(Object)} to determine if the 288 * targets of both events are equal. The standard implementation provided by 289 * this class performs a String comparison between the target strings. 290 * </p> 291 * <p> 292 * Subclasses can override this method to implemented more sophisticated 293 * means for the target comparison, e.g., to account for changes in the 294 * title of a widget. 295 * </p> 296 * 297 * @param otherTarget 298 * @return 299 */ 300 protected boolean targetEquals(String otherTarget) { 301 boolean retVal; 302 if (target != null) { 303 retVal = target.equals(otherTarget); 304 } else { 305 retVal = (otherTarget == null); 306 } 307 return retVal; 308 } 289 309 }
Note: See TracChangeset
for help on using the changeset viewer.