ctf/tmf: allow multiple traces to be open with name clashing events
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfTmfTimestamp.java
index ad13421b1858eb6b638834ffec697eaeb491a811..bff867e7bd56eba52e33de811d9575593ee5a9df 100644 (file)
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are made
  * available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
- * Contributors: Matthew Khouzam - Initial API and implementation
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 
 /**
- * The CTF adapter for the TMF timestamp
+ * The CTF adapter for the TMF timestamp. It's basically the same as a
+ * TmfTimestamp, but the scale is always nanoseconds, and the precision is 0.
  *
- * @version 1.1
+ * @version 1.2
  * @author Matthew khouzam
  */
-public class CtfTmfTimestamp extends TmfTimestamp {
-
-    /**
-     */
-    public enum TimestampType {
-        /**
-         * yyyy/mm/dd hh:mm:ss.nnnnnnnnnn
-         */
-        FULL_DATE,
-        /**
-         * hh:mm:ss.nnnnnnnnnn
-         */
-        DAY,
-        /**
-         * nnnnnnnnnnnnnnnnnnnnn ns
-         */
-        NANOS,
-        /**
-         * ssssssssss.nnnnnnnnnn s
-         */
-        SECONDS
-    }
-
-    private TimestampType type;
+public final class CtfTmfTimestamp extends TmfTimestamp {
 
     /**
      * Constructor for CtfTmfTimestamp.
-     * @param timestamp long
+     *
+     * @param timestamp
+     *            The timestamp value (in nanoseconds)
      */
     public CtfTmfTimestamp(long timestamp) {
         super(timestamp, ITmfTimestamp.NANOSECOND_SCALE, 0);
-        type = TimestampType.DAY;
-    }
-
-    /**
-     * Method setType.
-     * @param value TimestampType
-     */
-    public void setType(TimestampType value) {
-        type = value;
-    }
-
-    /**
-     * Method getType.
-     * @return TimestampType
-     */
-    public TimestampType getType() {
-        return type;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode() * prime;
-        result += ((type == null) ? 0 : type.toString().hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof CtfTmfTimestamp)) {
-            return false;
-        }
-        CtfTmfTimestamp other = (CtfTmfTimestamp) obj;
-        if (type != other.type) {
-            return false;
-        }
-        return true;
     }
 
 }
This page took 0.025031 seconds and 5 git commands to generate.