Implement TmfRangeSynchSignal toString
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / signal / TmfRangeSynchSignal.java
CommitLineData
8c8bf09f 1/*******************************************************************************
be4a197a 2 * Copyright (c) 2009, 2014 Ericsson
4f8ca6a1 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
4f8ca6a1 8 *
8c8bf09f
ASL
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
0fcf3b09 11 * Patrick Tasse - Deprecate current time
8c8bf09f
ASL
12 *******************************************************************************/
13
2bdf0193 14package org.eclipse.tracecompass.tmf.core.signal;
8c8bf09f 15
2bdf0193 16import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
8c8bf09f
ASL
17
18/**
0fcf3b09
PT
19 * A new time range has been selected.
20 *
21 * This is the visible (zoom) time range. To synchronize on the selection range,
22 * use {@link TmfTimeSynchSignal}.
4f8ca6a1 23 *
4b7b3670
FC
24 * @version 1.0
25 * @author Francois Chouinard
8c8bf09f
ASL
26 */
27public class TmfRangeSynchSignal extends TmfSignal {
28
c392540b 29 private final TmfTimeRange fCurrentRange;
8c8bf09f 30
0fcf3b09
PT
31 /**
32 * Constructor
33 *
34 * @param source
35 * Object sending this signal
36 * @param range
37 * The new time range
4b121c48 38 * @since 2.1
0fcf3b09
PT
39 */
40 public TmfRangeSynchSignal(Object source, TmfTimeRange range) {
41 super(source);
42 fCurrentRange = range;
c392540b 43 }
8c8bf09f 44
4f8ca6a1
AM
45 /**
46 * @return This signal's time range
3bd46eef 47 * @since 2.0
4f8ca6a1 48 */
c392540b
FC
49 public TmfTimeRange getCurrentRange() {
50 return fCurrentRange;
51 }
8c8bf09f 52
e9681c60
SM
53 @Override
54 public String toString() {
55 StringBuilder sb = new StringBuilder("TmfRangeSynchSignal [source="); //$NON-NLS-1$
56
57 if (getSource() != null) {
58 sb.append(getSource().toString());
59 } else {
60 sb.append("null"); //$NON-NLS-1$
61 }
62
63 sb.append(", range="); //$NON-NLS-1$
64
65 if (fCurrentRange != null) {
66 sb.append(fCurrentRange.toString());
67 } else {
68 sb.append("null"); //$NON-NLS-1$
69 }
70 sb.append(']');
71 return sb.toString();
72 }
8c8bf09f 73}
This page took 0.070558 seconds and 5 git commands to generate.