tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / TmfCheckpoint.java
index 0ff7084f7f46cd49a8bf0f2e7cd9dfd149635737..9c93ddcaaa2345a0d012aec5d8387992d95d974c 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2012 Ericsson
+ * Copyright (c) 2009, 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
@@ -9,11 +9,12 @@
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *   Francois Chouinard - Updated as per TMF Trace Model 1.0
+ *   Patrick Tasse - Updated for location in checkpoint
  ******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 
 /**
  * A basic implementation of ITmfCheckpoint. It simply maps an event timestamp
@@ -31,8 +32,8 @@ public class TmfCheckpoint implements ITmfCheckpoint {
     // Attributes
     // ------------------------------------------------------------------------
 
-    // The checkpoint context
-    private final ITmfContext fContext;
+    // The checkpoint location
+    private final ITmfLocation fLocation;
 
     // The checkpoint timestamp
     private final ITmfTimestamp fTimestamp;
@@ -45,11 +46,12 @@ public class TmfCheckpoint implements ITmfCheckpoint {
      * Full constructor
      *
      * @param timestamp the checkpoint timestamp
-     * @param context the corresponding trace location
+     * @param location the corresponding trace location
+     * @since 2.0
      */
-    public TmfCheckpoint(final ITmfTimestamp timestamp, final ITmfContext context) {
+    public TmfCheckpoint(final ITmfTimestamp timestamp, final ITmfLocation location) {
         fTimestamp = timestamp;
-        fContext = context;
+        fLocation = location;
     }
 
     /**
@@ -62,47 +64,30 @@ public class TmfCheckpoint implements ITmfCheckpoint {
             throw new IllegalArgumentException();
         }
         fTimestamp = other.fTimestamp;
-        fContext = other.fContext;
+        fLocation = other.fLocation;
     }
 
     // ------------------------------------------------------------------------
     // ITmfCheckpoint
     // ------------------------------------------------------------------------
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint#getTimestamp()
+    /**
+     * @since 2.0
      */
     @Override
     public ITmfTimestamp getTimestamp() {
         return fTimestamp;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint#getLocation()
-     */
-    @Override
-    public ITmfContext getContext() {
-        return fContext;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint#getLocation()
-     */
     @Override
     public ITmfLocation getLocation() {
-        return fContext.getLocation();
+        return fLocation;
     }
 
     // ------------------------------------------------------------------------
     // Comparable
     // ------------------------------------------------------------------------
 
-    /* (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint#compareTo(org.eclipse.linuxtools.tmf.core.trace.ITmfCheckpoint)
-     *
-     * Compares the checkpoints timestamp. If either is null, compares the
-     * trace checkpoints locations.
-     */
     @Override
     @SuppressWarnings({ "unchecked", "rawtypes" })
     public int compareTo(final ITmfCheckpoint other) {
@@ -115,17 +100,17 @@ public class TmfCheckpoint implements ITmfCheckpoint {
             // compare locations if timestamps are the same
         }
 
-        if ((getContext() == null) && (other.getContext() == null)) {
+        if ((fLocation == null) && (other.getLocation() == null)) {
             return 0;
         }
 
         // treat location of other as null location which is before any location
-        if ((getContext() != null) && (other.getContext() == null)) {
+        if ((fLocation != null) && (other.getLocation() == null)) {
             return 1;
         }
 
         // treat this as null location which is before any other locations
-        if ((getContext() == null) && (other.getContext() != null)) {
+        if ((fLocation == null) && (other.getLocation() != null)) {
             return -1;
         }
 
@@ -139,21 +124,15 @@ public class TmfCheckpoint implements ITmfCheckpoint {
     // Object
     // ------------------------------------------------------------------------
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((fContext == null) ? 0 : fContext.hashCode());
+        result = prime * result + ((fLocation == null) ? 0 : fLocation.hashCode());
         result = prime * result + ((fTimestamp == null) ? 0 : fTimestamp.hashCode());
         return result;
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
     @Override
     public boolean equals(final Object obj) {
         if (this == obj) {
@@ -166,11 +145,11 @@ public class TmfCheckpoint implements ITmfCheckpoint {
             return false;
         }
         final TmfCheckpoint other = (TmfCheckpoint) obj;
-        if (fContext == null) {
-            if (other.fContext != null) {
+        if (fLocation == null) {
+            if (other.fLocation != null) {
                 return false;
             }
-        } else if (!fContext.equals(other.fContext)) {
+        } else if (!fLocation.equals(other.fLocation)) {
             return false;
         }
         if (fTimestamp == null) {
@@ -183,13 +162,10 @@ public class TmfCheckpoint implements ITmfCheckpoint {
         return true;
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
-        return "TmfCheckpoint [fContext=" + fContext + ", fTimestamp=" + fTimestamp + "]";
+        return getClass().getSimpleName() + " [fLocation=" + fLocation + ", fTimestamp=" + fTimestamp + "]";
     }
 
 }
This page took 0.026456 seconds and 5 git commands to generate.