Changeset 375
- Timestamp:
- 01/31/12 11:56:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/Event.java
r373 r375 227 227 hash = multiplier * hash + type.hashCode(); 228 228 } 229 if (target != null) { 230 hash = multiplier * hash + target.hashCode(); 231 } 229 hash = multiplier * hash + targetHashCode(); 232 230 233 231 return hash; … … 296 294 * 297 295 * @param otherTarget 298 * @return 296 * other target string to which the target if this event is 297 * compared to 298 * @return true if the targets are equals; false otherwise 299 299 */ 300 300 protected boolean targetEquals(String otherTarget) { … … 307 307 return retVal; 308 308 } 309 310 /** 311 * <p> 312 * This function is used by {@link #hashCode()} to determine how the hash of 313 * the {@link #target}. It has to be overridden by subclasses that implement 314 * {@link #targetEquals(String)}, to ensure that the equals/hashCode 315 * contract remains valid. 316 * </p> 317 * 318 * @return hash of the target 319 */ 320 protected int targetHashCode() { 321 if (target != null) { 322 return target.hashCode(); 323 } else { 324 return 0; 325 } 326 } 309 327 }
Note: See TracChangeset
for help on using the changeset viewer.