| 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2013 É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.linuxtools.tmf.core.synchronization; |
| 14 | |
| 15 | import java.io.Serializable; |
| 16 | |
| 17 | import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; |
| 18 | |
| 19 | /** |
| 20 | * This class contains a formula to transform the value of a timestamp, for |
| 21 | * example after trace synchronization |
| 22 | * |
| 23 | * @author Geneviève Bastien |
| 24 | * @since 3.0 |
| 25 | */ |
| 26 | public interface ITmfTimestampTransform extends Serializable { |
| 27 | |
| 28 | /** |
| 29 | * Transforms a timestamp |
| 30 | * |
| 31 | * @param timestamp |
| 32 | * The timestamp to transform |
| 33 | * @return the transformed timestamp |
| 34 | */ |
| 35 | ITmfTimestamp transform(ITmfTimestamp timestamp); |
| 36 | |
| 37 | /** |
| 38 | * Transforms a timestamp value |
| 39 | * |
| 40 | * @param timestamp |
| 41 | * The timestamp to transform in nanoseconds |
| 42 | * @return the transformed value |
| 43 | */ |
| 44 | long transform(long timestamp); |
| 45 | |
| 46 | /** |
| 47 | * Returns a timestamp transform that is the composition of two timestamp |
| 48 | * transforms. |
| 49 | * |
| 50 | * @param composeWith |
| 51 | * The transform to first apply on the timestamp before applying |
| 52 | * the current object |
| 53 | * @return A new timestamp transform object with the resulting composition. |
| 54 | */ |
| 55 | ITmfTimestampTransform composeWith(ITmfTimestampTransform composeWith); |
| 56 | |
| 57 | } |