tmf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / TmfEventTypeCollectionHelper.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
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 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.trace;
14
15 import java.util.HashSet;
16 import java.util.Set;
17
18 import org.eclipse.linuxtools.tmf.core.event.ITmfEventType;
19
20 /**
21 * Set Helper for sets of ITmfTraceType
22 *
23 * TODO Remove once Java 8 is used (replace with Streams)
24 *
25 * @author Matthew Khouzam
26 * @since 3.0
27 */
28 public final class TmfEventTypeCollectionHelper {
29
30 private TmfEventTypeCollectionHelper() {
31 }
32
33 /**
34 * Gets the event names from a collection of event types
35 *
36 * @param eventTypes
37 * an iterable collection of ITmfEventTypes
38 * @return a set of the names of these events, if some names are clashing
39 * they will only appear once
40 */
41 public static Set<String> getEventNames(Iterable<ITmfEventType> eventTypes) {
42 Set<String> retSet = new HashSet<>();
43 for (ITmfEventType eventType : eventTypes) {
44 retSet.add(eventType.getName());
45 }
46 return retSet;
47 }
48 }
This page took 0.03197 seconds and 5 git commands to generate.