Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfTmfEventType.java
index 612abc056c3e8f5a5a2bbb09e1135d8ad4c796c8..585d30b3f990fc064651be2af890f841fbe79b05 100644 (file)
@@ -1,18 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
+import org.eclipse.linuxtools.tmf.core.event.TmfEventTypeManager;
 
+/**
+ * The CTF extension of the TMF event type
+ *
+ * @version 1.0
+ * @author Matthew khouzam
+ */
 public class CtfTmfEventType extends TmfEventType {
 
-    public CtfTmfEventType(String contextId, String eventName,
-            ITmfEventField content) {
-        super(contextId, eventName, content);
+    private static final String CONTEXT_ID = "Ctf Event"; //$NON-NLS-1$
+
+    /**
+     * Constructor for CtfTmfEventType.
+     *
+     * @param eventName
+     *            String
+     * @param content
+     *            ITmfEventField
+     */
+    public CtfTmfEventType(String eventName, ITmfEventField content) {
+        super(CONTEXT_ID, eventName, content);
     }
 
+    /**
+     * Method toString.
+     *
+     * @return String
+     */
     @Override
-    public String toString()
-    {
+    public String toString() {
         return this.getName();
     }
+
+    /**
+     * gets the event type for an event name
+     *
+     * @param eventName
+     *            the event name
+     * @return the event type
+     */
+    public static CtfTmfEventType get(String eventName){
+        return (CtfTmfEventType) TmfEventTypeManager.getInstance().getType(CONTEXT_ID, eventName);
+    }
 }
This page took 0.024316 seconds and 5 git commands to generate.