Commit | Line | Data |
---|---|---|
faa38350 PT |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 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 | * Patrick Tasse - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.core.signal; | |
14 | ||
15 | import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange; | |
16 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; | |
17 | ||
18 | /** | |
19 | * Signal indicating a trace range has been updated. | |
20 | * | |
21 | * Receivers can safely perform event requests for the specified time range. | |
22 | * The signal acts as a trigger for coalescing such requests. | |
23 | * | |
24 | * @version 1.0 | |
25 | * @author Patrick Tasse | |
26 | * @since 2.0 | |
27 | */ | |
28 | public class TmfTraceRangeUpdatedSignal extends TmfSignal { | |
29 | ||
30 | private final ITmfTrace fTrace; | |
31 | private final TmfTimeRange fTimeRange; | |
32 | ||
33 | /** | |
34 | * Constructor | |
35 | * | |
36 | * @param source | |
37 | * Object sending this signal | |
38 | * @param trace | |
39 | * Trace whose range was updated | |
40 | * @param range | |
41 | * The new time range of the trace | |
42 | */ | |
43 | public TmfTraceRangeUpdatedSignal(Object source, ITmfTrace trace, TmfTimeRange range) { | |
44 | super(source); | |
45 | fTrace = trace; | |
46 | fTimeRange = range; | |
47 | } | |
48 | ||
49 | /** | |
50 | * @return The trace | |
51 | */ | |
52 | public ITmfTrace getTrace() { | |
53 | return fTrace; | |
54 | } | |
55 | ||
56 | /** | |
57 | * @return The time range | |
58 | */ | |
59 | public TmfTimeRange getRange() { | |
60 | return fTimeRange; | |
61 | } | |
62 | ||
63 | /* (non-Javadoc) | |
64 | * @see java.lang.Object#toString() | |
65 | */ | |
66 | @Override | |
67 | @SuppressWarnings("nls") | |
68 | public String toString() { | |
69 | return "[TmfTraceRangeUpdatedSignal (" + fTrace.getName() + ", " + fTimeRange.toString() + ")]"; | |
70 | } | |
71 | ||
72 | } |