1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.event
;
16 * <b><u>ITmfTimestamp</u></b>
18 * The fundamental time reference in the TMF.
20 * It defines a generic timestamp interface in its most basic form:
22 * <li>timestamp = [value] * 10**[scale] +/- [precision]
26 * <li>[value] is an unstructured integer value
27 * <li>[scale] is the magnitude of the value wrt some application-specific
28 * base unit (e.g. the second)
29 * <li>[precision] indicates the error on the value (useful for comparing
30 * timestamps in different scales). Default: 0.
33 public interface ITmfTimestamp
extends Cloneable
, Comparable
<ITmfTimestamp
> {
36 * @return the timestamp value (magnitude)
38 public long getValue();
41 * @return the timestamp scale (exponent)
43 public int getScale();
46 * @return the timestamp precision (measurement tolerance)
48 public int getPrecision();
51 * Normalize (adjust scale and offset) of the timerstamp
53 * @param offset the offset to apply to the timestamp value (after scaling)
54 * @param scale the new timestamp scale
55 * @return a new 'adjusted' ITmfTimestamp
57 public ITmfTimestamp
normalize(long offset
, int scale
) throws ArithmeticException
;
60 * Compares [this] and [ts] within timestamp precision
62 * @param ts the other timestamp
63 * @param withinPrecision consider the precision when testing for equality
64 * @return -1, 0 or 1 (less than, equals, greater than)
66 public int compareTo(ITmfTimestamp ts
, boolean withinPrecision
);
69 * Returns the difference between [this] and [ts] as a timestamp
71 * @param ts the other timestamp
72 * @return the time difference (this - other) as an ITmfTimestamp
74 public ITmfTimestamp
getDelta(ITmfTimestamp ts
);
77 * @return a clone of the timestamp
79 public ITmfTimestamp
clone();
82 * @see java.lang.Comparable#compareTo(java.lang.Object)
85 public int compareTo(ITmfTimestamp ts
);
This page took 0.031462 seconds and 5 git commands to generate.