analysis: introduce ISegmentStoreProvider
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.timing.core / src / org / eclipse / tracecompass / analysis / timing / core / segmentstore / AbstractSegmentStoreAnalysisModule.java
index 32930e3159a644f2a1d31a37bf83668b34a1799c..f5db4dde2fc00d245305c0b88c733a834de0cc28 100644 (file)
@@ -17,7 +17,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -35,8 +35,6 @@ import org.eclipse.tracecompass.tmf.core.segment.ISegmentAspect;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
 
-import com.google.common.collect.ImmutableList;
-
 /**
  * Abstract analysis module to generate a segment store. It is a base class that
  * can be used as a shortcut by analysis who just need to build a single segment
@@ -46,7 +44,7 @@ import com.google.common.collect.ImmutableList;
  * @since 2.0
  *
  */
-public abstract class AbstractSegmentStoreAnalysisModule extends TmfAbstractAnalysisModule {
+public abstract class AbstractSegmentStoreAnalysisModule extends TmfAbstractAnalysisModule implements ISegmentStoreProvider {
 
     private final ListenerList fListeners = new ListenerList(ListenerList.IDENTITY);
 
@@ -54,22 +52,12 @@ public abstract class AbstractSegmentStoreAnalysisModule extends TmfAbstractAnal
 
     private @Nullable ITmfEventRequest fOngoingRequest = null;
 
-    /**
-     * Listener for the viewers
-     *
-     * @param listener
-     *            listener for each type of viewer
-     */
+    @Override
     public void addListener(IAnalysisProgressListener listener) {
         fListeners.add(listener);
     }
 
-    /**
-     * Removes a listener for the viewers
-     *
-     * @param listener
-     *            listener for each type of viewer to remove
-     */
+    @Override
     public void removeListener(IAnalysisProgressListener listener) {
         fListeners.remove(listener);
     }
@@ -89,16 +77,9 @@ public abstract class AbstractSegmentStoreAnalysisModule extends TmfAbstractAnal
         return listeners;
     }
 
-    /**
-     * Return the pre-defined set of segment aspects exposed by this analysis.
-     *
-     * It should not be null, but could be empty.
-     *
-     * @return The segment aspects for this analysis
-     */
+    @Override
     public Iterable<ISegmentAspect> getSegmentAspects() {
-        Collection<ISegmentAspect> coll = ImmutableList.of();
-        return checkNotNull(coll);
+        return Collections.emptyList();
     }
 
     /**
@@ -132,11 +113,7 @@ public abstract class AbstractSegmentStoreAnalysisModule extends TmfAbstractAnal
      */
     protected abstract Object[] readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException;
 
-    /**
-     * Returns the segment store built by this analysis
-     *
-     * @return The segment store
-     */
+    @Override
     public @Nullable ISegmentStore<ISegment> getSegmentStore() {
         return fSegmentStore;
     }
This page took 0.026481 seconds and 5 git commands to generate.