7cdd4e8de66ad89655c8b2292db4fe4918d9244a
1 /*******************************************************************************
2 * Copyright (c) 2014, 2015 Ericsson
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
10 * Alexandre Montplaisir - Initial API and implementation
11 * Patrick Tasse - Added base aspect list
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
;
16 import org
.eclipse
.jdt
.annotation
.Nullable
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
20 * An aspect is a piece of information that can be extracted, directly or
21 * indirectly, from a trace event.
23 * Simple examples could be timestamp, or event fields. But it could also be
24 * something like a state system request, at the timestamp of the given event.
26 * The aspect can then be used to populate event table columns, to filter
27 * on to only keep certain events, to plot XY charts, etc.
29 * @author Alexandre Montplaisir
30 * @param <T> Type of the return value of the {@link #resolve} method
32 public interface ITmfEventAspect
<T
> {
35 * Static definition of an empty string. You can use this instead of 'null'!
37 String EMPTY_STRING
= ""; //$NON-NLS-1$
40 * Get the name of this aspect. This name will be user-visible and, as such,
41 * should be localized.
43 * @return The name of this aspect.
48 * Return a descriptive help text of what this aspect does. This could then
49 * be shown in tooltip or in option dialogs for instance. It should also be
52 * You can return {@link #EMPTY_STRING} if you judge that the aspect name
55 * @return The help text of this aspect
60 * The "functor" representing this aspect. Basically, what to do for an
61 * event that is passed in parameter.
63 * Note to implementers:
65 * The parameter type here is {@link ITmfEvent}. This is because you could
66 * receive any type of event here. Do not assume you will only receive
67 * events of your own trace type. It is perfectly fine to return
68 * {@link #EMPTY_STRING} for event types you don't support.
70 * You also can (and should) provide a more specific return type than
74 * The event to process
75 * @return The resulting tidbit of information for this event.
77 @Nullable T
resolve(ITmfEvent event
);
This page took 0.042629 seconds and 4 git commands to generate.