Integrate the TmfEvent+ITmfTimestamp API
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / ITmfTimestamp.java
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 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.event;
14
15 /**
16 * <b><u>ITmfTimestamp</u></b>
17 * <p>
18 */
19 public interface ITmfTimestamp extends Cloneable, Comparable<ITmfTimestamp> {
20
21 /**
22 * @return the timestamp value (magnitude)
23 */
24 public long getValue();
25
26 /**
27 * @return the timestamp scale (exponent)
28 */
29 public int getScale();
30
31 /**
32 * @return the timestamp precision (measurement tolerance)
33 */
34 public int getPrecision();
35
36 /**
37 * Normalize (adjust scale and offset) of the timerstamp
38 *
39 * @param offset the offset to apply to the timestamp value (after scaling)
40 * @param scale the new timestamp scale
41 * @return a new 'adjusted' ITmfTimestamp
42 */
43 public ITmfTimestamp normalize(long offset, int scale) throws ArithmeticException;
44
45 /**
46 * Compares [this] and [ts] within timestamp precision
47 *
48 * @param ts the other timestamp
49 * @param withinPrecision consider the precision when testing for equality
50 * @return -1, 0 or 1 (less than, equals, greater than)
51 */
52 public int compareTo(ITmfTimestamp ts, boolean withinPrecision);
53
54 /**
55 * Returns the difference between [this] and [ts] as a timestamp
56 *
57 * @param ts the other timestamp
58 * @return the time difference (this - other) as an ITmfTimestamp
59 */
60 public ITmfTimestamp getDelta(ITmfTimestamp ts);
61
62 // Cloneable
63 public ITmfTimestamp clone();
64
65 // Comparable
66 public int compareTo(ITmfTimestamp ts);
67
68 }
This page took 0.030269 seconds and 5 git commands to generate.