tmf/lttng: Update 2014 copyrights
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / parsers / custom / CustomEventType.java
CommitLineData
a0a88f65 1/*******************************************************************************
60ae41e1 2 * Copyright (c) 2010, 2014 Ericsson
a0a88f65
AM
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made 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:
10 * Patrick Tassé - Initial API and implementation
11 *******************************************************************************/
12
47aafe74 13package org.eclipse.linuxtools.tmf.core.parsers.custom;
be222f56
PT
14
15import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
16import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
17import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
18
a0a88f65
AM
19/**
20 * Event type for custom text parsers.
21 *
22 * @author Patrick Tassé
47aafe74 23 * @since 3.0
a0a88f65 24 */
be222f56 25public abstract class CustomEventType extends TmfEventType {
a0a88f65 26
be222f56 27 private static String CONTEXT_ID = "CustomEventType"; //$NON-NLS-1$
a0a88f65
AM
28
29 /**
30 * Constructor
31 *
32 * @param definition
33 * Trace definition
34 */
be222f56
PT
35 public CustomEventType(CustomTraceDefinition definition) {
36 super(CONTEXT_ID, definition.definitionName, getRootField(definition));
37 }
38
39 private static ITmfEventField getRootField(CustomTraceDefinition definition) {
40 ITmfEventField[] fields = new ITmfEventField[definition.outputs.size()];
41 for (int i = 0; i < fields.length; i++) {
214cc822 42 fields[i] = new TmfEventField(definition.outputs.get(i).name, null, null);
be222f56 43 }
214cc822 44 ITmfEventField rootField = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, fields);
be222f56
PT
45 return rootField;
46 }
47
48}
This page took 0.035455 seconds and 5 git commands to generate.