tmf: Add an ID to each state system that gets built
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / signal / TmfStateSystemBuildCompleted.java
index d94e893c7ce9e1e5fbeeecbc86857e6f4cb7ea8b..2f0721033c94a5059ec0c70d4dc5119af4dac32f 100644 (file)
@@ -23,6 +23,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 public class TmfStateSystemBuildCompleted extends TmfSignal {
 
     private final ITmfTrace fTrace;
+    private final String fID;
 
     /**
      * Constructor
@@ -31,10 +32,16 @@ public class TmfStateSystemBuildCompleted extends TmfSignal {
      *            Object sending this signal
      * @param trace
      *            The state system of which trace just finished building
+     * @param id
+     *            ID associated with this state system. This can be used in the
+     *            case of a trace containing multiple state systems, to
+     *            differentiate between them.
+     * @since 2.0
      */
-    public TmfStateSystemBuildCompleted(Object source, ITmfTrace trace) {
+    public TmfStateSystemBuildCompleted(Object source, ITmfTrace trace, String id) {
         super(source);
         fTrace = trace;
+        fID = id;
     }
 
     /**
@@ -44,12 +51,21 @@ public class TmfStateSystemBuildCompleted extends TmfSignal {
         return fTrace;
     }
 
+    /**
+     * @return The ID of the state system that just finished building
+     * @since 2.0
+     */
+    public String getID() {
+        return fID;
+    }
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
     @Override
     public String toString() {
-        return "[TmfStateSystemBuildCompleted (" + fTrace.toString() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$
+        return "[TmfStateSystemBuildCompleted (trace = " + fTrace.toString() + //$NON-NLS-1$
+                ", ID = " + fID + ")]"; //$NON-NLS-1$ //$NON-NLS-2$
     }
 
 }
This page took 0.024371 seconds and 5 git commands to generate.