tmf: add comparator getter to ISegmentAspect interface
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Wed, 14 Oct 2015 11:06:09 +0000 (07:06 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Fri, 23 Oct 2015 20:01:47 +0000 (16:01 -0400)
Change-Id: Ida38b31726076eaa5b3b465933033cf6e22b0ac7
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/58261
Reviewed-by: Hudson CI
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/LatencyAnalysis.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/AbstractSegmentStoreTableViewer.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/segment/ISegmentAspect.java

index a58f8910f407903c26e982744e5343b67d6f4e35..99fbeb68ad2bbf50d7a5cb4dd231ce03dcb4dbe6 100644 (file)
@@ -14,6 +14,7 @@ import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -162,6 +163,10 @@ public class LatencyAnalysis extends AbstractSegmentStoreAnalysisModule {
             return checkNotNull(Messages.SegmentAspectName_SystemCall);
         }
         @Override
+        public @Nullable Comparator<?> getComparator() {
+            return null;
+        }
+        @Override
         public @Nullable String resolve(ISegment segment) {
             if (segment instanceof SystemCall) {
                 return ((SystemCall) segment).getName();
index aabe29c4999501b9d962e21f63b7bfb34a71b66a..8e518bcd345f041e839587db31a28227803a7bff 100644 (file)
@@ -187,7 +187,7 @@ public abstract class AbstractSegmentStoreTableViewer extends TmfSimpleTableView
                             return NonNullUtils.nullToEmptyString(aspect.resolve(input));
                         }
                     },
-                    null);
+                    aspect.getComparator());
                 }
             }
             fColumnsCreated = true;
index 722ee628241d153b7199f392c0e0a4d780186414..2c76804dabfb5f0477207dcad241d6a156deb687 100644 (file)
@@ -9,6 +9,8 @@
 
 package org.eclipse.tracecompass.tmf.core.segment;
 
+import java.util.Comparator;
+
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 
@@ -48,6 +50,12 @@ public interface ISegmentAspect {
      */
     String getHelpText();
 
+    /**
+     * Gets the comparator to be used when comparing to segments.
+     * @return the comparator to be used when comparing to segments
+     */
+    @Nullable Comparator<?> getComparator();
+
     /**
      * The "functor" representing this aspect. Basically, what to do for an
      * segment that is passed in parameter.
@@ -60,4 +68,5 @@ public interface ISegmentAspect {
      * @return The resulting information for this segment.
      */
     @Nullable Object resolve(ISegment segment);
+
 }
This page took 0.027826 seconds and 5 git commands to generate.