Various fixes following code review
authorFrancois Chouinard <fchouinard@gmail.com>
Fri, 17 Feb 2012 23:03:05 +0000 (18:03 -0500)
committerFrancois Chouinard <fchouinard@gmail.com>
Fri, 17 Feb 2012 23:03:05 +0000 (18:03 -0500)
24 files changed:
org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/lttng/core/trace/LTTngTrace.java
org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/common/AbsTimeUpdateView.java
org.eclipse.linuxtools.lttng.ui/src/org/eclipse/linuxtools/lttng/ui/views/events/EventsTable.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampTest.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/stubs/trace/TmfTraceStub.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfEventField.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/ITmfTimestamp.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventField.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventType.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfEventTypeManager.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfSimpleTimestamp.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimeRange.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/event/TmfTimestamp.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/parsers/custom/CustomTxtEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/BasicFrame.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/ExecutionOccurrence.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/Frame.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/impl/TmfUml2SDSyncLoader.java

index 7abeb2fa8b1982a1f70651efa4fde39fe5a21b39..069d4d30c8464823f1e49f2a3a8967ba0fd1e4a1 100644 (file)
@@ -703,7 +703,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
         context.updateRank(1);
     }
 
-    protected void updateIndex(TmfContext context, long rank, TmfTimestamp timestamp) {
+    protected void updateIndex(TmfContext context, long rank, ITmfTimestamp timestamp) {
 
         if (getStartTime().compareTo(timestamp, false) > 0)
             setStartTime(timestamp);
@@ -724,7 +724,7 @@ public class LTTngTrace extends TmfTrace<LttngEvent> {
         }
     }
 
-    private void addCheckPoint(TmfContext context, TmfTimestamp timestamp) {
+    private void addCheckPoint(TmfContext context, ITmfTimestamp timestamp) {
         ITmfLocation<?> location = context.getLocation().clone();
         fCheckpoints.add(new TmfCheckpoint(timestamp.clone(), location));
     }
index 4559d043b6af488525719dd472d425dc467bb122..685ba8b55c0318985ddbf2692ff2a97586a108a6 100644 (file)
@@ -553,7 +553,7 @@ public abstract class AbsTimeUpdateView extends TmfView implements IRequestStatu
        protected TmfTimeRange getInitTRange(TmfTimeRange experimentTRange) {
                ITmfTimestamp expStartTime = experimentTRange.getStartTime();
                ITmfTimestamp expEndTime = experimentTRange.getEndTime();
-               TmfTimestamp initialEndOfWindow = new LttngTimestamp(expStartTime
+               ITmfTimestamp initialEndOfWindow = new LttngTimestamp(expStartTime
                                .getValue()
                                + INITIAL_WINDOW_OFFSET);
                if (initialEndOfWindow.compareTo(expEndTime, false) < 0) {
index 7a4deab4d742d0e9acfbcec7a0330c1eea37929a..48b088af25d74767c0df1ba648633e1de86edb10 100644 (file)
@@ -14,6 +14,7 @@
 package org.eclipse.linuxtools.lttng.ui.views.events;\r
 \r
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
+import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;\r
 import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventsTable;\r
@@ -63,8 +64,8 @@ public class EventsTable extends TmfEventsTable {
      * @return\r
      */\r
     @Override\r
-    protected TmfEventField[] extractItemFields(TmfEvent event) {\r
-        TmfEventField[] fields = new TmfEventField[0];\r
+    protected ITmfEventField[] extractItemFields(TmfEvent event) {\r
+        ITmfEventField[] fields = new TmfEventField[0];\r
         if (event != null) {\r
             fields = new TmfEventField[] {\r
                      new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, ((Long) event.getTimestamp().getValue()).toString()),\r
index 30be0b83452ce6687d24869069981bdbf6c2c33f..3c08785994924bfb4535c659587f9b5799ba9456 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009 Ericsson
+ * Copyright (c) 2009, 2012 Ericsson
  * 
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -8,6 +8,7 @@
  * 
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
+ *   Francois Chouinard - Revisit for TMF Event Model 1.0
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.tests.event;
index 6b8ef8ac0069b3af54e068e842a7bb7b9cecd200..171b9e0c73fb613e6353291566cb63b9b01d75c2 100644 (file)
@@ -20,7 +20,6 @@ import java.util.concurrent.locks.ReentrantLock;
 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
@@ -246,7 +245,7 @@ public class TmfTraceStub extends TmfTrace<TmfEvent> {
     }
 
        @Override
-       public void setStartTime(TmfTimestamp startTime) {
+       public void setStartTime(ITmfTimestamp startTime) {
        super.setStartTime(startTime);
     }
 
index 8b421a2b19595a06307f0447d788a6c7029e9764..36ea96763a9a59b37388025d28f9640668b8f276 100644 (file)
@@ -26,7 +26,7 @@ public interface ITmfEventField extends Cloneable {
     public static final String ROOT_ID = ":root:"; //$NON-NLS-1$
     
     /**
-     * @return the field ID
+     * @return the field name
      */
     public String getName();
 
index 089a9b3176b5322d5dd6209af0dbca31098ebd63..7e1c34976ac3d1f0f3691c014ab269208fa40acb 100644 (file)
@@ -81,6 +81,7 @@ public interface ITmfTimestamp extends Cloneable, Comparable<ITmfTimestamp> {
     /* (non-Javadoc)
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
+    @Override
     public int compareTo(ITmfTimestamp ts);
 
 }
index f78fe03165995987df29feba28e079bd9abc189c..91a88f3a997648f3c84af8b380e07ee2569bfcde 100644 (file)
@@ -20,8 +20,9 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
  * <p>
  * A basic implementation of ITmfEvent.
  * 
- * Note that for performance reasons TmfEvent is NOT immutable. If a copy of
- * the event is needed, use the copy constructor.
+ * Note that for performance reasons TmfEvent is NOT immutable. If a shallow
+ * copy of the event is needed, use the copy constructor. Otherwise (deep copy)
+ * use clone().
  */
 public class TmfEvent implements ITmfEvent {
 
@@ -29,12 +30,39 @@ public class TmfEvent implements ITmfEvent {
     // Attributes
     // ------------------------------------------------------------------------
 
+    /**
+     * The trace containing the event
+     */
     protected ITmfTrace<? extends TmfEvent> fTrace;
+
+    /**
+     * The event rank within the trace
+     */
     protected long fRank;
+    
+    /**
+     * The event timestamp
+     */
     protected ITmfTimestamp fTimestamp;
+    
+    /**
+     * The event source
+     */
     protected String fSource;
+    
+    /**
+     * The event type
+     */
     protected ITmfEventType fType;
+    
+    /**
+     * The event content (root field)
+     */
     protected ITmfEventField fContent;
+    
+    /**
+     * The event reference
+     */
     protected String fReference;
 
     // ------------------------------------------------------------------------
@@ -59,7 +87,7 @@ public class TmfEvent implements ITmfEvent {
      * @param reference the event reference
      */
     public TmfEvent(ITmfTrace<? extends TmfEvent> trace, long rank, ITmfTimestamp timestamp, String source,
-                    TmfEventType type, ITmfEventField content, String reference)
+                    ITmfEventType type, ITmfEventField content, String reference)
     {
         fTrace = trace;
         fRank = rank;
@@ -74,7 +102,7 @@ public class TmfEvent implements ITmfEvent {
      * Constructor - no rank
      */
     public TmfEvent(ITmfTrace<? extends TmfEvent> trace, ITmfTimestamp timestamp, String source,
-            TmfEventType type, ITmfEventField content, String reference)
+            ITmfEventType type, ITmfEventField content, String reference)
     {
         this(trace, -1, timestamp, source, type, content, reference);
     }
@@ -83,7 +111,7 @@ public class TmfEvent implements ITmfEvent {
      * Constructor - no rank, no content
      */
     public TmfEvent(ITmfTrace<? extends TmfEvent> trace, ITmfTimestamp timestamp, String source,
-            TmfEventType type, String reference)
+            ITmfEventType type, String reference)
     {
         this(trace, -1, timestamp, source, type, null, reference);
     }
@@ -91,7 +119,7 @@ public class TmfEvent implements ITmfEvent {
     /**
      * Constructor - no rank, no content, no trace
      */
-    public TmfEvent(TmfTimestamp timestamp, String source, TmfEventType type, String reference)
+    public TmfEvent(TmfTimestamp timestamp, String source, ITmfEventType type, String reference)
     {
         this(null, -1, timestamp, source, type, null, reference);
     }
@@ -117,30 +145,58 @@ public class TmfEvent implements ITmfEvent {
     // ITmfEvent
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getTrace()
+     */
+    @Override
     public ITmfTrace<? extends TmfEvent> getTrace() {
         return fTrace;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getRank()
+     */
+    @Override
     public long getRank() {
         return fRank;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getTimestamp()
+     */
+    @Override
     public ITmfTimestamp getTimestamp() {
         return fTimestamp;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getSource()
+     */
+    @Override
     public String getSource() {
         return fSource;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getType()
+     */
+    @Override
     public ITmfEventType getType() {
         return fType;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getContent()
+     */
+    @Override
     public ITmfEventField getContent() {
         return fContent;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEvent#getReference()
+     */
+    @Override
     public String getReference() {
         return fReference;
     }
@@ -166,7 +222,7 @@ public class TmfEvent implements ITmfEvent {
     /**
      * @param type the new event type
      */
-    public void setType(TmfEventType type) {
+    public void setType(ITmfEventType type) {
         fType = type;
     }
 
@@ -188,6 +244,9 @@ public class TmfEvent implements ITmfEvent {
     // Cloneable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#clone()
+     */
     @Override
     public TmfEvent clone() {
         TmfEvent clone = null;
@@ -209,6 +268,9 @@ public class TmfEvent implements ITmfEvent {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -223,6 +285,9 @@ public class TmfEvent implements ITmfEvent {
         return result;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -267,6 +332,9 @@ public class TmfEvent implements ITmfEvent {
         return true;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index ca5fd9dfe7dd9e6c5e510074916107bb84997e3b..7211ba451d8ee0b84638a01bb092dc196ae5210a 100644 (file)
@@ -101,18 +101,34 @@ public class TmfEventField implements ITmfEventField {
     // ITmfEventField
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getName()
+     */
+    @Override
     public String getName() {
         return fName;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getValue()
+     */
+    @Override
     public Object getValue() {
         return fValue;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getFieldNames()
+     */
+    @Override
     public String[] getFieldNames() {
         return fFieldNames;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getFieldName(int)
+     */
+    @Override
     public String getFieldName(int index) {
         ITmfEventField field = getField(index);
         if (field != null) {
@@ -121,14 +137,27 @@ public class TmfEventField implements ITmfEventField {
         return null;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getFields()
+     */
+    @Override
     public ITmfEventField[] getFields() {
         return fFields;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getField(java.lang.String)
+     */
+    @Override
     public ITmfEventField getField(String name) {
+        // FIXME: Add treatment for 'special' fields 
         return fNameMapping.get(name);
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getField(int)
+     */
+    @Override
     public ITmfEventField getField(int index) {
         if (index >= 0 && index < fFields.length)
             return fFields[index];
@@ -186,6 +215,9 @@ public class TmfEventField implements ITmfEventField {
     // Cloneable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#clone()
+     */
     @Override
     public ITmfEventField clone() {
         TmfEventField clone = null;
@@ -204,6 +236,9 @@ public class TmfEventField implements ITmfEventField {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -213,6 +248,9 @@ public class TmfEventField implements ITmfEventField {
         return result;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -235,6 +273,9 @@ public class TmfEventField implements ITmfEventField {
         return true;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index 70793a4d81ec7850052c129e79ed6c96b13c1224..0982319050961e1e21f34a79cbef3adf18d78f30 100644 (file)
@@ -67,29 +67,49 @@ public class TmfEventType implements ITmfEventType {
                throw new IllegalArgumentException();
        fContext = type.fContext;
                fTypeId  = type.fTypeId;
-               fRootField    = type.fRootField;
+               fRootField = type.fRootField;
        }
 
     // ------------------------------------------------------------------------
     // ITmfEventType
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getContext()
+     */
+    @Override
        public String getContext() {
                return fContext;
        }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getName()
+     */
+    @Override
     public String getName() {
         return fTypeId;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getRootField()
+     */
+    @Override
     public ITmfEventField getRootField() {
         return fRootField;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getFieldNames()
+     */
+    @Override
     public String[] getFieldNames() {
         return (fRootField != null) ? fRootField.getFieldNames() : null;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfEventType#getFieldName(int)
+     */
+    @Override
     public String getFieldName(int index) {
         return (fRootField != null) ? fRootField.getFieldName(index) : null;
     }
@@ -98,6 +118,9 @@ public class TmfEventType implements ITmfEventType {
     // Cloneable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#clone()
+     */
     @Override
     public ITmfEventType clone() {
         TmfEventType clone = null;
@@ -116,6 +139,9 @@ public class TmfEventType implements ITmfEventType {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -125,6 +151,9 @@ public class TmfEventType implements ITmfEventType {
         return result;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -147,6 +176,9 @@ public class TmfEventType implements ITmfEventType {
         return true;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index 614f5d1db7ee80789dece111791ec8ff02b31d91..0c649ab97160947878df3803ad42d2934abc289b 100644 (file)
@@ -37,10 +37,16 @@ public final class TmfEventTypeManager {
     // Constructors
     // ------------------------------------------------------------------------
 
+    /**
+     * The singleton constructor
+     */
     private TmfEventTypeManager() {
         fEventTypes = new HashMap<String, HashMap<String, ITmfEventType>>();
     }
 
+    /**
+     * @return the TmfEventTypeManager singleton
+     */
     public static synchronized TmfEventTypeManager getInstance() {
         if (fEventTypeManager == null) {
             fEventTypeManager = new TmfEventTypeManager();
@@ -125,6 +131,9 @@ public final class TmfEventTypeManager {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index b83672050d400d236f002878071dd3df60547e80..8e6816c2b3c9f0df34262e13f50bc114b3a15352 100644 (file)
@@ -56,6 +56,9 @@ public class TmfSimpleTimestamp extends TmfTimestamp {
     // ITmfTimestamp
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.TmfTimestamp#normalize(long, int)
+     */
     @Override
     public ITmfTimestamp normalize(long offset, int scale) throws ArithmeticException {
         if (scale == 0) {
@@ -64,6 +67,9 @@ public class TmfSimpleTimestamp extends TmfTimestamp {
         return super.normalize(offset, scale);
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.TmfTimestamp#compareTo(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp, boolean)
+     */
     @Override
     public int compareTo(ITmfTimestamp ts, boolean withinPrecision) {
         if (ts instanceof TmfSimpleTimestamp) {
@@ -73,6 +79,9 @@ public class TmfSimpleTimestamp extends TmfTimestamp {
         return super.compareTo(ts, withinPrecision);
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.TmfTimestamp#getDelta(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp)
+     */
     @Override
     public ITmfTimestamp getDelta(ITmfTimestamp ts) {
         if (ts instanceof TmfSimpleTimestamp) {
@@ -85,6 +94,9 @@ public class TmfSimpleTimestamp extends TmfTimestamp {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.TmfTimestamp#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object other) {
         if (this == other)
@@ -97,6 +109,9 @@ public class TmfSimpleTimestamp extends TmfTimestamp {
         return compareTo(ts, false) == 0;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.TmfTimestamp#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index 8ca69f9bc351ffc74f7af95afac906d862848a29..75f03c47417f829cdb561fe0528f0cb8e1bd56ff 100644 (file)
@@ -24,9 +24,15 @@ public class TmfTimeRange implements Cloneable {
     // Constants
     // ------------------------------------------------------------------------
 
+    /**
+     * The full possible time range
+     */
     public static final TmfTimeRange Eternity =
         new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigCrunch);
 
+    /**
+     * The null time range
+     */
     public static final TmfTimeRange Null =
         new TmfTimeRange(TmfTimestamp.BigBang, TmfTimestamp.BigBang);
 
@@ -59,8 +65,8 @@ public class TmfTimeRange implements Cloneable {
         if (startTime == null || endTime == null) {
             throw new IllegalArgumentException();
         }
-        fStartTime = startTime.clone();
-        fEndTime = endTime.clone();
+        fStartTime = startTime;
+        fEndTime = endTime;
     }
 
     /**
@@ -72,8 +78,8 @@ public class TmfTimeRange implements Cloneable {
         if (range == null) {
             throw new IllegalArgumentException();
         }
-        fStartTime = range.getStartTime().clone();
-        fEndTime = range.getEndTime().clone();
+        fStartTime = range.getStartTime();
+        fEndTime = range.getEndTime();
     }
 
     // ------------------------------------------------------------------------
@@ -146,6 +152,10 @@ public class TmfTimeRange implements Cloneable {
     // Cloneable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#clone()
+     */
+    @Override
     public TmfTimeRange clone() {
         TmfTimeRange clone = null;
         try {
@@ -162,6 +172,9 @@ public class TmfTimeRange implements Cloneable {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -171,6 +184,9 @@ public class TmfTimeRange implements Cloneable {
         return result;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -193,6 +209,9 @@ public class TmfTimeRange implements Cloneable {
         return true;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index 78f619b37aaf413704bfc4cdb07038c6d26ac930..636c66a7772ceaf4e11f7869fa56d413a6d8a925 100644 (file)
@@ -25,18 +25,42 @@ public class TmfTimestamp implements ITmfTimestamp {
     // Constants
     // ------------------------------------------------------------------------
 
-    // The beginning and end of time
-    public static final ITmfTimestamp BigBang   = new TmfTimestamp(Long.MIN_VALUE, Integer.MAX_VALUE, 0);
-    public static final ITmfTimestamp BigCrunch = new TmfTimestamp(Long.MAX_VALUE, Integer.MAX_VALUE, 0);
-    public static final ITmfTimestamp Zero      = new TmfTimestamp(0, 0, 0);
+    /**
+     * The beginning of time
+     */
+    public static final ITmfTimestamp BigBang = 
+            new TmfTimestamp(Long.MIN_VALUE, Integer.MAX_VALUE, 0);
+
+    /**
+     * The end of time
+     */
+    public static final ITmfTimestamp BigCrunch = 
+            new TmfTimestamp(Long.MAX_VALUE, Integer.MAX_VALUE, 0);
+    
+    /**
+     * Zero
+     */
+    public static final ITmfTimestamp Zero = 
+            new TmfTimestamp(0, 0, 0);
 
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
 
-    protected long fValue;    // The timestamp raw value
-    protected int fScale;     // The time scale
-    protected int fPrecision; // The value precision (tolerance)
+    /**
+     * The timestamp raw value (mantissa)
+     */
+    protected long fValue;
+
+    /**
+     * The timestamp scale (magnitude)
+     */
+    protected int fScale;
+
+    /**
+     * The value precision (tolerance)
+     */
+    protected int fPrecision;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -98,14 +122,26 @@ public class TmfTimestamp implements ITmfTimestamp {
     // ITmfTimestamp
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#getValue()
+     */
+    @Override
     public long getValue() {
         return fValue;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#getScale()
+     */
+    @Override
     public int getScale() {
         return fScale;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#getPrecision()
+     */
+    @Override
     public int getPrecision() {
         return fPrecision;
     }
@@ -132,6 +168,10 @@ public class TmfTimestamp implements ITmfTimestamp {
         1000000000000000000L,
     };
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#normalize(long, int)
+     */
+    @Override
     public ITmfTimestamp normalize(long offset, int scale) throws ArithmeticException {
 
         long value = fValue;
@@ -168,6 +208,10 @@ public class TmfTimestamp implements ITmfTimestamp {
         return new TmfTimestamp(value, scale, precision);
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#compareTo(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp, boolean)
+     */
+    @Override
     public int compareTo(ITmfTimestamp ts, boolean withinPrecision) {
 
         // Check the corner cases (we can't use equals() because it uses compareTo()...)
@@ -204,6 +248,9 @@ public class TmfTimestamp implements ITmfTimestamp {
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#getDelta(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp)
+     */
     @Override
     public ITmfTimestamp getDelta(ITmfTimestamp ts) {
         ITmfTimestamp nts = ts.normalize(0, fScale);
@@ -215,6 +262,9 @@ public class TmfTimestamp implements ITmfTimestamp {
     // Cloneable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#clone()
+     */
     @Override
     public ITmfTimestamp clone() {
         TmfTimestamp clone = null;
@@ -232,6 +282,9 @@ public class TmfTimestamp implements ITmfTimestamp {
     // Comparable
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#compareTo(org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp)
+     */
     @Override
     public int compareTo(ITmfTimestamp ts) {
         return compareTo(ts, false);
@@ -241,6 +294,9 @@ public class TmfTimestamp implements ITmfTimestamp {
     // Object
     // ------------------------------------------------------------------------
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -251,6 +307,9 @@ public class TmfTimestamp implements ITmfTimestamp {
         return result;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     @Override
     public boolean equals(Object other) {
         if (this == other)
@@ -263,6 +322,9 @@ public class TmfTimestamp implements ITmfTimestamp {
         return compareTo(ts, false) == 0;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
     @Override
     @SuppressWarnings("nls")
     public String toString() {
index c84afa5d0127477ddccccca7258adb226ffa435b..268ed2a2767c53a457c74ccab540d82d117733e8 100644 (file)
@@ -280,7 +280,7 @@ public abstract class TmfTrace<T extends TmfEvent> extends TmfEventProvider<T> i
         fEndTime = range.getEndTime();
     }
 
-    protected void setStartTime(TmfTimestamp startTime) {
+    protected void setStartTime(ITmfTimestamp startTime) {
         fStartTime = startTime;
     }
 
index 2f4ef2064244f9b3bd83bfcde5d195ab412377c1..6dd2644bc4e48609b7964f2d35935c21a648fb92 100644 (file)
@@ -14,9 +14,9 @@ package org.eclipse.linuxtools.tmf.ui.parsers.custom;
 \r
 import java.util.regex.Matcher;\r
 \r
+import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;\r
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;\r
 import org.eclipse.linuxtools.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputData;\r
 import org.eclipse.linuxtools.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputLine;\r
@@ -32,7 +32,7 @@ public class CustomTxtEvent extends CustomEvent {
         super(definition, other);\r
     }\r
 \r
-    public CustomTxtEvent(CustomTxtTraceDefinition definition, ITmfTrace<?> parentTrace, TmfTimestamp timestamp, String source, TmfEventType type, String reference) {\r
+    public CustomTxtEvent(CustomTxtTraceDefinition definition, ITmfTrace<?> parentTrace, ITmfTimestamp timestamp, String source, TmfEventType type, String reference) {\r
         super(definition, parentTrace, timestamp, source, type, reference);\r
     }\r
 \r
index 03945036bebdcccca1d9245a3a4e8e4da2215e63..260bfdb557d396ed60aaa4625068fc336e11baae 100644 (file)
@@ -45,6 +45,7 @@ import org.eclipse.jface.resource.LocalResourceManager;
 import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;\r
 import org.eclipse.linuxtools.tmf.core.component.TmfComponent;\r
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
+import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;\r
 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;\r
@@ -648,7 +649,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }\r
 \r
     protected void setItemData(TableItem item, TmfEvent event, long rank) {\r
-        TmfEventField[] fields = extractItemFields(event);\r
+        ITmfEventField[] fields = extractItemFields(event);\r
         String[] content = new String[fields.length];\r
         for (int i = 0; i < fields.length; i++) {\r
             content[i] = (String) fields[i].getValue();\r
@@ -1371,8 +1372,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
      *         FIXME: Add support for column selection\r
      */\r
     //TmfEventContent content, String id, Object value\r
-    protected TmfEventField[] extractItemFields(TmfEvent event) {\r
-        TmfEventField[] fields = new TmfEventField[0];\r
+    protected ITmfEventField[] extractItemFields(TmfEvent event) {\r
+        ITmfEventField[] fields = new TmfEventField[0];\r
         if (event != null) {\r
             fields = new TmfEventField[] {\r
                      new TmfEventField(ITmfEvent.EVENT_FIELD_TIMESTAMP, ((Long) event.getTimestamp().getValue()).toString()),\r
index ed056de09409eae1a26c5ff8305a0e3b091279a4..4668efbf3fd026f3d5045775595af830a9fd07c1 100644 (file)
@@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;\r
 import org.eclipse.jface.viewers.StructuredSelection;\r
 import org.eclipse.jface.viewers.TreeViewer;\r
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventType;\r
 import org.eclipse.linuxtools.tmf.core.event.TmfEvent;\r
 import org.eclipse.linuxtools.tmf.core.filter.model.ITmfFilterTreeNode;\r
@@ -338,7 +339,7 @@ class FilterViewer extends Composite {
                     for (IConfigurationElement ce : TmfTraceType.getTypeElements()) {\r
                         if (ce.getAttribute(TmfTraceType.EVENT_TYPE_ATTR).equals(eventTypeNode.getEventType())) {\r
                             try {\r
-                                TmfEvent event = (TmfEvent) ce.createExecutableExtension(TmfTraceType.EVENT_TYPE_ATTR);\r
+                                ITmfEvent event = (TmfEvent) ce.createExecutableExtension(TmfTraceType.EVENT_TYPE_ATTR);\r
                                 ITmfEventType eventType = event.getType();\r
                                 if (eventType != null) {\r
                                     for (String field : eventType.getRootField().getFieldNames()) {\r
index ddd8718002ee3ec5243c3ece137e22678fb6d433..4d8be6b97f1d6ab316a813b84b2f3b66f828c7ce 100755 (executable)
@@ -126,11 +126,11 @@ public class DrawableToolTip implements PaintListener {
         int step = SCALE_LENGTH / 10;
 
         // double gr = (max - min) / 10;
-        TmfTimestamp minMaxdelta = (TmfTimestamp) minMaxRange.getEndTime().getDelta(minMaxRange.getStartTime());
+        ITmfTimestamp minMaxdelta = (TmfTimestamp) minMaxRange.getEndTime().getDelta(minMaxRange.getStartTime());
         double gr = (minMaxdelta.getValue()) / (double) 10;
 
         // double delta = currentValue-min;
-        TmfTimestamp delta = (TmfTimestamp) currentValue.getDelta(minMaxRange.getStartTime());
+        ITmfTimestamp delta = (TmfTimestamp) currentValue.getDelta(minMaxRange.getStartTime());
         long absDelta = Math.abs(delta.getValue());
         
         int colIndex = 0;
index 98b6e031fc7d3bcc5b4543e6b8e2f083c5419ae9..d1b7eff7528d992c9b11b5e56fb241959ec754b3 100755 (executable)
@@ -331,10 +331,10 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
 
             min = frame.getMinTime();
             max = frame.getMaxTime();
-            TmfTimestamp minMaxdelta = (TmfTimestamp) max.getDelta(min);
+            ITmfTimestamp minMaxdelta = (TmfTimestamp) max.getDelta(min);
             double gr = (minMaxdelta.getValue()) / (double) 10;
 
-            TmfTimestamp delta = (TmfTimestamp) m2.getTime().getDelta(m1.getTime()).getDelta(min);
+            ITmfTimestamp delta = (TmfTimestamp) m2.getTime().getDelta(m1.getTime()).getDelta(min);
             long absDelta = Math.abs(delta.getValue());
             
             ColorImpl color;
index 3bff886a371573b659e677d37c2b88e7eb298039..1dc7f2dd0e9f68561edeca7c2091ca8128de490c 100755 (executable)
@@ -374,12 +374,12 @@ public class BasicFrame extends GraphNode {
         return minTime;
     }
 
-    public void setMin(TmfTimestamp min) {
+    public void setMin(ITmfTimestamp min) {
         minTime = min;
         customMinMax = true;
     }
 
-    public void setMax(TmfTimestamp max) {
+    public void setMax(ITmfTimestamp max) {
         maxTime = max;
         customMinMax = true;
     }
index 721274eb87e63eed4eed03c5a51c1f12fe186068..2c165b393285af49e01b69a0ac83b6dde707a044 100755 (executable)
@@ -13,7 +13,6 @@
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.core;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IImage;
@@ -93,7 +92,7 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
      * 
      * @param time the time when the execution occurrence starts
      */
-    public void setStartTime(TmfTimestamp time) {
+    public void setStartTime(ITmfTimestamp time) {
         startTime = time.clone();
         hasTime = true;
         if (lifeline != null) {
@@ -106,7 +105,7 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
      * 
      * @param time the time when the execution occurrence ends
      */
-    public void setEndTime(TmfTimestamp time) {
+    public void setEndTime(ITmfTimestamp time) {
         endTime = time.clone();
         hasTime = true;
         if (lifeline != null) {
index b481188c70eb7c6e60c7eafd9731664b8edf9baf..9c0ab261dfc2c5c5512f644153a0459c357ad5f5 100755 (executable)
@@ -18,7 +18,6 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.SDViewPref;
@@ -470,7 +469,7 @@ public class Frame extends BasicFrame {
      * @param bounds a two items array that will receive bounds if found
      * @return true if both bounds not null
      */
-    public boolean findDateBounds(TmfTimestamp dateToFind, ITimeRange bounds[]) {
+    public boolean findDateBounds(ITmfTimestamp dateToFind, ITimeRange bounds[]) {
         if (hasTimeInfo()) {
             List<SDTimeEvent> timeArray = buildTimeArray();
             bounds[0] = null;
index 7e7d5d408d9882d530546b4f5c2959b728be9dfd..a6f41c70c037d41c5abdd00a6b26009ba63f3405 100644 (file)
@@ -327,7 +327,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
         try {
             if ((signal.getSource() != this) && (fFrame != null) && !fIsSignalSent) {
                 TmfTimeRange newTimeRange = signal.getCurrentRange();
-                TmfTimestamp delta = (TmfTimestamp) newTimeRange.getEndTime().getDelta(newTimeRange.getStartTime());
+                ITmfTimestamp delta = (TmfTimestamp) newTimeRange.getEndTime().getDelta(newTimeRange.getStartTime());
                 fInitialWindow = delta.getValue();
 
                 fIsSelect = false;
This page took 0.044181 seconds and 5 git commands to generate.