tmf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / internal / tmf / core / synchronization / TmfTimestampTransform.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 École Polytechnique de Montréal
3 *
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
8 *
9 * Contributors:
10 * Geneviève Bastien - Initial implementation and API
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.internal.tmf.core.synchronization;
14
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.tracecompass.tmf.core.synchronization.ITmfTimestampTransform;
17 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
18
19 /**
20 * A default simple, identity timestamp transform. It is a singleton class and
21 * returns the timestamp itself
22 *
23 * @author Geneviève Bastien
24 */
25 public final class TmfTimestampTransform implements ITmfTimestampTransformInvertible {
26
27 /**
28 * Generated serial UID
29 */
30 private static final long serialVersionUID = -1480581417493073304L;
31
32 /**
33 * The unique instance of this transform, since it is always the same
34 */
35 public static final @NonNull TmfTimestampTransform IDENTITY = new TmfTimestampTransform();
36
37 /**
38 * Default constructor
39 */
40 private TmfTimestampTransform() {
41
42 }
43
44 @Override
45 public ITmfTimestamp transform(ITmfTimestamp timestamp) {
46 return timestamp;
47 }
48
49 @Override
50 public long transform(long timestamp) {
51 return timestamp;
52 }
53
54 @Override
55 public ITmfTimestampTransform composeWith(ITmfTimestampTransform composeWith) {
56 /* Since this transform will not modify anything, return the other */
57 return composeWith;
58 }
59
60 @Override
61 public String toString() {
62 return "TmfTimestampTransform [ IDENTITY ]"; //$NON-NLS-1$
63 }
64
65 @Override
66 public ITmfTimestampTransform inverse() {
67 return IDENTITY;
68 }
69
70 }
This page took 0.048484 seconds and 5 git commands to generate.