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 MK |
18 | /** |
19 | */ | |
ce2388e0 FC |
20 | public class CtfTmfEventType extends TmfEventType { |
21 | ||
aa572e22 | 22 | private static final String CONTEXT_ID = "Ctf Event"; //$NON-NLS-1$ |
b1baa808 MK |
23 | /** |
24 | * Constructor for CtfTmfEventType. | |
25 | * @param contextId String | |
26 | * @param eventName String | |
27 | * @param content ITmfEventField | |
28 | */ | |
e30ce12e | 29 | public CtfTmfEventType(String eventName, ITmfEventField content) { |
aa572e22 | 30 | super(CONTEXT_ID, eventName, content); |
ce2388e0 FC |
31 | } |
32 | ||
b1baa808 MK |
33 | /** |
34 | * Method toString. | |
35 | * @return String | |
36 | */ | |
ce2388e0 | 37 | @Override |
e30ce12e | 38 | public String toString() { |
ce2388e0 FC |
39 | return this.getName(); |
40 | } | |
aa572e22 | 41 | |
9ac2eb62 MK |
42 | /** |
43 | * gets the event type for an event name | |
44 | * @param eventName the event name | |
45 | * @return the event type | |
46 | */ | |
aa572e22 MK |
47 | public static CtfTmfEventType get(String eventName){ |
48 | return (CtfTmfEventType) TmfEventTypeManager.getInstance().getType(CONTEXT_ID, eventName); | |
49 | } | |
ce2388e0 | 50 | } |