Commit | Line | Data |
---|---|---|
b1baa808 MK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are made | |
5 | * available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: Matthew Khouzam - Initial API and implementation | |
10 | *******************************************************************************/ | |
11 | ||
ce2388e0 FC |
12 | package org.eclipse.linuxtools.tmf.core.ctfadaptor; |
13 | ||
14 | import org.eclipse.linuxtools.tmf.core.event.ITmfEventField; | |
15 | import org.eclipse.linuxtools.tmf.core.event.TmfEventType; | |
aa572e22 | 16 | import org.eclipse.linuxtools.tmf.core.event.TmfEventTypeManager; |
ce2388e0 | 17 | |
b1baa808 | 18 | /** |
d09f973b FC |
19 | * The CTF extension of the TMF event type |
20 | * | |
21 | * @version 1.0 | |
22 | * @author Matthew khouzam | |
b1baa808 | 23 | */ |
ce2388e0 FC |
24 | public class CtfTmfEventType extends TmfEventType { |
25 | ||
aa572e22 | 26 | private static final String CONTEXT_ID = "Ctf Event"; //$NON-NLS-1$ |
b1baa808 MK |
27 | /** |
28 | * Constructor for CtfTmfEventType. | |
29 | * @param contextId String | |
30 | * @param eventName String | |
31 | * @param content ITmfEventField | |
32 | */ | |
e30ce12e | 33 | public CtfTmfEventType(String eventName, ITmfEventField content) { |
aa572e22 | 34 | super(CONTEXT_ID, eventName, content); |
ce2388e0 FC |
35 | } |
36 | ||
b1baa808 MK |
37 | /** |
38 | * Method toString. | |
39 | * @return String | |
40 | */ | |
ce2388e0 | 41 | @Override |
e30ce12e | 42 | public String toString() { |
ce2388e0 FC |
43 | return this.getName(); |
44 | } | |
aa572e22 | 45 | |
9ac2eb62 MK |
46 | /** |
47 | * gets the event type for an event name | |
48 | * @param eventName the event name | |
49 | * @return the event type | |
50 | */ | |
aa572e22 MK |
51 | public static CtfTmfEventType get(String eventName){ |
52 | return (CtfTmfEventType) TmfEventTypeManager.getInstance().getType(CONTEXT_ID, eventName); | |
53 | } | |
ce2388e0 | 54 | } |