Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 Ericsson |
6256d8ad | 3 | * |
8c8bf09f ASL |
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 | |
6256d8ad | 8 | * |
8c8bf09f ASL |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.core.signal; |
8c8bf09f | 14 | |
2bdf0193 AM |
15 | import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange; |
16 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; | |
8c8bf09f ASL |
17 | |
18 | /** | |
faa38350 PT |
19 | * Signal indicating a trace has been updated. |
20 | * | |
21 | * The trace has been indexed up to the specified range. | |
6256d8ad | 22 | * |
4b7b3670 | 23 | * @author Francois Chouinard |
8c8bf09f ASL |
24 | */ |
25 | public class TmfTraceUpdatedSignal extends TmfSignal { | |
26 | ||
6256d8ad | 27 | private final ITmfTrace fTrace; |
4f8ca6a1 | 28 | private final TmfTimeRange fTimeRange; |
032ecd45 | 29 | private final long fNbEvents; |
4f8ca6a1 AM |
30 | |
31 | /** | |
32 | * Constructor | |
33 | * | |
34 | * @param source | |
35 | * Object sending this signal | |
36 | * @param trace | |
37 | * The trace that was updated | |
38 | * @param range | |
39 | * The new time range of the trace | |
032ecd45 MAL |
40 | * @param nbEvents |
41 | * The number of events in the trace | |
4f8ca6a1 | 42 | */ |
032ecd45 | 43 | public TmfTraceUpdatedSignal(Object source, ITmfTrace trace, TmfTimeRange range, long nbEvents) { |
4f8ca6a1 AM |
44 | super(source); |
45 | fTrace = trace; | |
46 | fTimeRange = range; | |
032ecd45 | 47 | fNbEvents = nbEvents; |
4f8ca6a1 AM |
48 | } |
49 | ||
50 | /** | |
51 | * @return The trace referred to by this signal | |
52 | */ | |
6256d8ad | 53 | public ITmfTrace getTrace() { |
4f8ca6a1 AM |
54 | return fTrace; |
55 | } | |
56 | ||
57 | /** | |
58 | * @return The time range indicated by this signal | |
59 | */ | |
60 | public TmfTimeRange getRange() { | |
61 | return fTimeRange; | |
62 | } | |
63 | ||
032ecd45 MAL |
64 | /** |
65 | * Returns the number of events indicated by this signal | |
66 | * | |
67 | * @return the number of events indicated by this signal | |
68 | */ | |
69 | public long getNbEvents() { | |
70 | return fNbEvents; | |
71 | } | |
72 | ||
4f8ca6a1 | 73 | @Override |
3b38ea61 | 74 | @SuppressWarnings("nls") |
4f8ca6a1 AM |
75 | public String toString() { |
76 | return "[TmfTraceUpdatedSignal (" + fTrace.toString() + ", " | |
77 | + fTimeRange.toString() + ")]"; | |
78 | } | |
8c8bf09f ASL |
79 | |
80 | } |