tmf: Cache CallStackEvent names
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / widgets / timegraph / model / TimeEvent.java
index 189b8bafc38fb07860eee62a217e7c7a2bb42ca5..c66ea4d8f15f4d0fd19d424c0121a0562e9edaa2 100644 (file)
@@ -13,6 +13,8 @@
 
 package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model;
 
+import java.util.Objects;
+
 /**
  * Generic TimeEvent implementation
  *
@@ -120,6 +122,29 @@ public class TimeEvent implements ITimeEvent {
                 null);
     }
 
+    @Override
+    public int hashCode() {
+        return Objects.hash(fEntry, fTime, fDuration, fValue);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        TimeEvent other = (TimeEvent) obj;
+        return Objects.equals(fEntry, other.fEntry) &&
+                Objects.equals(fTime, other.fTime) &&
+                Objects.equals(fDuration, other.fDuration) &&
+                Objects.equals(fValue, other.fValue);
+    }
+
     @Override
     public String toString() {
         return getClass().getSimpleName() + " start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + (hasValue() ? (" value=" + fValue) : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
This page took 0.024913 seconds and 5 git commands to generate.