analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / statistics / TmfStatisticsEventTypesModule.java
index dcfa11cbf29c62b014459a80da93d2079f085502..0ad0c8b652593e5f2b6f790db194b56876f71740 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
 
 package org.eclipse.tracecompass.tmf.core.statistics;
 
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.linuxtools.statesystem.core.exceptions.AttributeNotFoundException;
-import org.eclipse.linuxtools.statesystem.core.exceptions.StateValueTypeException;
-import org.eclipse.linuxtools.statesystem.core.exceptions.TimeRangeException;
-import org.eclipse.linuxtools.statesystem.core.statevalue.TmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
+import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
 import org.eclipse.tracecompass.tmf.core.statesystem.AbstractTmfStateProvider;
@@ -33,17 +36,15 @@ import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
  * TmfAnalysisManager), as it is being handled by the TmfStatisticsModule.
  *
  * @author Alexandre Montplaisir
- * @since 3.0
  */
 public class TmfStatisticsEventTypesModule extends TmfStateSystemAnalysisModule {
 
     /**
      * The ID of this analysis module (which is also the ID of the state system)
      */
-    @NonNull
-    public static final String ID = "org.eclipse.linuxtools.tmf.statistics.types"; //$NON-NLS-1$
+    public static final @NonNull String ID = "org.eclipse.linuxtools.tmf.statistics.types"; //$NON-NLS-1$
 
-    private static final String NAME = "TMF Statistics, events per type"; //$NON-NLS-1$
+    private static final @NonNull String NAME = "TMF Statistics, events per type"; //$NON-NLS-1$
 
     /**
      * Constructor
@@ -56,7 +57,7 @@ public class TmfStatisticsEventTypesModule extends TmfStateSystemAnalysisModule
 
     @Override
     protected ITmfStateProvider createStateProvider() {
-        return new StatsProviderEventTypes(getTrace());
+        return new StatsProviderEventTypes(checkNotNull(getTrace()));
     }
 
     @Override
@@ -101,8 +102,8 @@ public class TmfStatisticsEventTypesModule extends TmfStateSystemAnalysisModule
          * @param trace
          *            The trace for which we build this state system
          */
-        public StatsProviderEventTypes(ITmfTrace trace) {
-            super(trace, ITmfEvent.class ,"TMF Statistics, events per type"); //$NON-NLS-1$
+        public StatsProviderEventTypes(@NonNull ITmfTrace trace) {
+            super(trace ,"TMF Statistics, events per type"); //$NON-NLS-1$
         }
 
         @Override
@@ -117,13 +118,14 @@ public class TmfStatisticsEventTypesModule extends TmfStateSystemAnalysisModule
 
         @Override
         protected void eventHandle(ITmfEvent event) {
+            ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
             int quark;
 
             /* Since this can be used for any trace types, normalize all the
              * timestamp values to nanoseconds. */
             final long ts = event.getTimestamp().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue();
 
-            final String eventName = event.getType().getName();
+            final String eventName = event.getName();
 
             try {
                 /* Special handling for lost events */
This page took 0.036804 seconds and 5 git commands to generate.