diff options
Diffstat (limited to 'lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java')
-rw-r--r-- | lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java index 13ee08a6ea..7fbe99c6a9 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/timestamp/TmfTimestamp.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 Ericsson + * Copyright (c) 2009, 2013 Ericsson, École Polytechnique de Montréal * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -11,6 +11,7 @@ * Thomas Gatterweh - Updated scaling / synchronization * Francois Chouinard - Refactoring to align with TMF Event Model 1.0 * Francois Chouinard - Implement augmented interface + * Geneviève Bastien - Added copy constructor with new value *******************************************************************************/ package org.eclipse.linuxtools.tmf.core.timestamp; @@ -134,6 +135,24 @@ public class TmfTimestamp implements ITmfTimestamp { fPrecision = timestamp.getPrecision(); } + /** + * Copies a timestamp but with a new time value + * + * @param timestamp + * The timestamp to copy + * @param newvalue + * The value the new timestamp will have + * @since 3.0 + */ + public TmfTimestamp(ITmfTimestamp timestamp, long newvalue) { + if (timestamp == null) { + throw new IllegalArgumentException(); + } + fValue = newvalue; + fScale = timestamp.getScale(); + fPrecision = timestamp.getPrecision(); + } + // ------------------------------------------------------------------------ // ITmfTimestamp // ------------------------------------------------------------------------ |