Changeset 405


Ignore:
Timestamp:
04/03/12 10:15:39 (12 years ago)
Author:
sherbold
Message:
  • updated de.ugoe.cs.eventbench.data.ReplayableEvent? such that equals does not take the replay messages into account anymore.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/data/ReplayableEvent.java

    r336 r405  
    160160                this.decorator = decorator; 
    161161        } 
    162  
    163         /* 
    164          * (non-Javadoc) 
    165          *  
    166          * @see de.ugoe.cs.eventbench.data.Event#equals(java.lang.Object) 
    167          */ 
    168         @Override 
    169         public boolean equals(Object other) { 
    170                 if (this == other) { 
    171                         return true; 
    172                 } 
    173                 if (other instanceof ReplayableEvent<?>) { 
    174                         ReplayableEvent<?> otherEvent = (ReplayableEvent<?>) other; 
    175                         if (replayEvents != null) { 
    176                                 return super.equals(otherEvent) 
    177                                                 && replayEvents.equals(otherEvent.replayEvents) 
    178                                                 && replayValid == otherEvent.replayValid; 
    179                         } else { 
    180                                 return super.equals(otherEvent) 
    181                                                 && otherEvent.replayEvents == null 
    182                                                 && replayValid == otherEvent.replayValid; 
    183                         } 
    184  
    185                 } else { 
    186                         return false; 
    187                 } 
    188         } 
    189162         
    190163        @Override 
     
    192165                return (other instanceof ReplayableEvent<?>); 
    193166        } 
    194  
    195         /* 
    196          * (non-Javadoc) 
    197          *  
    198          * @see de.ugoe.cs.eventbench.data.Event#hashCode() 
    199          */ 
    200         @Override 
    201         public int hashCode() { 
    202                 int multiplier = 17; 
    203                 int hash = super.hashCode(); 
    204                 if (replayEvents != null) { 
    205                         hash = multiplier * hash + replayEvents.hashCode(); 
    206                 } 
    207                 hash = multiplier * hash + (replayValid ? 1 : 0); 
    208  
    209                 return hash; 
    210         } 
    211167} 
Note: See TracChangeset for help on using the changeset viewer.