tmf: formatting of tmf.ui.statistics
authorMathieu Denis <mathieu.denis@polymtl.ca>
Thu, 26 Jul 2012 19:48:21 +0000 (15:48 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 2 Aug 2012 17:33:44 +0000 (13:33 -0400)
- Remove trailing whitespaces;
- Replace tabs for spaces;
- Remove html tags;
- Format blocks;
- Correct warnings.

Change-Id: I560b7d9c66e2ed23c3850ecf9e74ccc4ffaf8779
Signed-off-by: Mathieu Denis <mathieu.denis@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/7005
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
24 files changed:
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/util/TmfFixedArrayTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/util/TmfFixedArray.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/AllTmfUITests.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/AllTests.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataProviderTest.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseColumnDataTest.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfBaseStatisticsDataTest.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeNodeTest.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfStatisticsTreeRootFactoryTest.java
org.eclipse.linuxtools.tmf.ui.tests/src/org/eclipse/linuxtools/tmf/ui/tests/statistics/TmfTreeContentProviderTest.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/ITmfExtraEventInfo.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfColumnDataProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfStatisticsColumnData.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseStatisticsTree.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatistics.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeNode.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfTreeContentProvider.java

index cf58a894524774e073d666187e3de682182119ad..5a6961d3a3912a5c569c99b1751d2a60c1f3355f 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.tests.util;
@@ -20,11 +20,10 @@ import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
 
 /**
  * <b><u>TmfFixedArrayTest</u></b>
- * <p>
+ *
  * Implement me. Please.
- * <p>
  */
-@SuppressWarnings({"nls","javadoc"})
+@SuppressWarnings({ "nls", "javadoc" })
 public class TmfFixedArrayTest extends TestCase {
 
     // ------------------------------------------------------------------------
@@ -45,7 +44,8 @@ public class TmfFixedArrayTest extends TestCase {
         fString4 = "Fourth String";
         fString5 = "Fifth String";
         fFixedArray1 = new TmfFixedArray<String>(fString1, fString2, fString3);
-        fFixedArray2 = new TmfFixedArray<String>(); // Empty array at the beginning
+        // Empty array at the beginning
+        fFixedArray2 = new TmfFixedArray<String>();
     }
 
     @Override
@@ -70,8 +70,7 @@ public class TmfFixedArrayTest extends TestCase {
         try {
             fFixedArray2.get(0);
             fail();
-        }
-        catch (ArrayIndexOutOfBoundsException e) {
+        } catch (ArrayIndexOutOfBoundsException e) {
             // Success
         }
     }
@@ -140,12 +139,11 @@ public class TmfFixedArrayTest extends TestCase {
         assertTrue("append", fString4.equals(fixedArray.get(3)));
     }
 
-
     @SuppressWarnings("unchecked")
     public void testAppendFixedArray() {
         TmfFixedArray<String> fixedArrayToAppend1 = new TmfFixedArray<String>(fString4);
         TmfFixedArray<String> fixedArrayToAppend2 = new TmfFixedArray<String>(fString5);
-        TmfFixedArray<String> fixedArray         = new TmfFixedArray<String>();
+        TmfFixedArray<String> fixedArray          = new TmfFixedArray<String>();
 
         fixedArray = fixedArray.append(fFixedArray1, fixedArrayToAppend1);
         assertEquals("append", 4, fixedArray.size());
@@ -179,7 +177,7 @@ public class TmfFixedArrayTest extends TestCase {
     // ------------------------------------------------------------------------
 
     public void testToArray() {
-        String[] expected1 = {fString1, fString2, fString3};
+        String[] expected1 = { fString1, fString2, fString3 };
         assertTrue("toArray", Arrays.equals(expected1, fFixedArray1.toArray()));
 
         String[] expected2 = {};
@@ -197,7 +195,7 @@ public class TmfFixedArrayTest extends TestCase {
         fFixedArray1.toArray(stringBigArray);
         assertNull("toArrayArg", stringBigArray[3]);
 
-        TmfFixedArray<Object> fFixedArrayObject  = new TmfFixedArray<Object>(fString1);
+        TmfFixedArray<Object> fFixedArrayObject = new TmfFixedArray<Object>(fString1);
         stringArray = fFixedArrayObject.toArray(new String[0]);
         assertTrue("toArrayArg", stringArray[0].equals(fString1));
     }
index f38fd5f0ef02bc1ebbad7c356353cadc758a9187..1144ba89cc975ebc43dc5124ce9f43f3f5978623 100755 (executable)
@@ -7,8 +7,8 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Francois Godin (copelnug@gmail.com)        - Initial design and implementation
- *   Mathieu Denis  (mathieu.denis@polymtl.ca)  - Correction and refactoring
+ *   Francois Godin <copelnug@gmail.com> - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Correction and refactoring
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.core.util;
@@ -20,38 +20,53 @@ import java.util.List;
 import java.util.RandomAccess;
 
 /**
- * <h4>Allow to create a List object that contain an already existing array.</h4>
- * <p>Works like {@link java.util.Arrays#asList} but offers more functions :
+ * Allow to create a List object that contain an already existing array. Works
+ * like {@link java.util.Arrays#asList} but contains more functions :
  * <ul>
- *  <li>{@link #hashCode()}</li>
- *  <li>{@link #equals(Object)}</li>
- * </ul></p>
- * <p>Those functions allow to use the FixedArray as the key of a {@link java.util.HashMap}.</p>
+ * <li>{@link #hashCode()}</li>
+ * <li>{@link #equals(Object)}</li>
+ * </ul>
+ * Those functions allow to use the FixedArray as the key of a
+ * {@link java.util.HashMap}.
  *
  * @version 1.0
  * @author Francois Godin
  *
- * @param <T> Type of the array content.
+ * @param <T>
+ *            Type of the array content.
  */
 public final class TmfFixedArray<T> extends AbstractList<T> implements RandomAccess, Cloneable {
     /**
-     * Replace {@link java.util.Arrays#copyOf(Object[], int)} that do not exist in java 5.
-     * @param <E> Content of the array.
-     * @param array Original array to copy from.
-     * @param newLength Length of the copy to be returned.
+     * Replace {@link java.util.Arrays#copyOf(Object[], int)} that do not exist
+     * in java 5.
+     *
+     * @param <E>
+     *            Content of the array.
+     * @param array
+     *            Original array to copy from.
+     * @param newLength
+     *            Length of the copy to be returned.
      * @return A new array consisting of the elements specified.
      */
     private static <E> E[] copyOf(final E[] array, int newLength) {
-        E[] result = (E[])Array.newInstance(array.getClass().getComponentType(), newLength); // Is it useful to use newInstance?
+        // FIXME Is it useful to use newInstance?
+        E[] result = (E[]) Array.newInstance(array.getClass().getComponentType(), newLength);
         System.arraycopy(array, 0, result, 0, Math.min(array.length, newLength));
         return result;
     }
+
     /**
-     * Replace {@link java.util.Arrays#copyOf(Object[], int, Class)} that do not exist in java 5.
-     * @param <E> Content of the array.
-     * @param array Original array to copy from.
-     * @param newLength Length of the copy to be returned.
-     * @param newType Type of the array to be returned.
+     * Replace {@link java.util.Arrays#copyOf(Object[], int, Class)} that do not
+     * exist in java 5.
+     *
+     * @param <E>
+     *            Content of the array.
+     * @param array
+     *            Original array to copy from.
+     * @param newLength
+     *            Length of the copy to be returned.
+     * @param newType
+     *            Type of the array to be returned.
      * @return A new array consisting of the elements specified.
      */
     private static <E, U> E[] copyOf(final U[] array, int newLength, Class<? extends E[]> newType) {
@@ -59,33 +74,48 @@ public final class TmfFixedArray<T> extends AbstractList<T> implements RandomAcc
         System.arraycopy(array, 0, result, 0, Math.min(array.length, newLength));
         return result;
     }
+
     /**
-     * Replace {@link java.util.Arrays#copyOfRange(Object[], int, int)} that do not exist in java 5.
-     * @param <E> Content of the array.
-     * @param array Original array to copy from.
-     * @param start Starting position of the range, inclusive.
-     * @param end Ending position of the range, exclusive.
-     * @return A new array consisting of the elements specified. The length of the new array is equal to end-start
+     * Replace {@link java.util.Arrays#copyOfRange(Object[], int, int)} that do
+     * not exist in java 5.
+     *
+     * @param <E>
+     *            Content of the array.
+     * @param array
+     *            Original array to copy from.
+     * @param start
+     *            Starting position of the range, inclusive.
+     * @param end
+     *            Ending position of the range, exclusive.
+     * @return A new array consisting of the elements specified. The length of
+     *         the new array is equal to end-start
      */
     private static <E> E[] copyOfRange(final E[] array, int start, int end) {
         E[] result = (E[])Array.newInstance(array.getClass().getComponentType(), end - start);
         System.arraycopy(array, start, result, 0, end - start);
         return result;
     }
+
     /**
      * The array.
      */
     private final T[] fArray;
+
     /**
      * Constructor.
-     * @param array Array to use. WILL NOT BE COPIED.
+     *
+     * @param array
+     *            Array to use. WILL NOT BE COPIED.
      */
     public TmfFixedArray(final T... array) {
         fArray = array;
     }
+
     /**
      * Append a FixedArray to this FixedArray.
-     * @param value The FixedArray to append.
+     *
+     * @param value
+     *            The FixedArray to append.
      * @return A new FixedArray with the elements of the two FixedArray.
      */
     public TmfFixedArray<T> append(final TmfFixedArray<T> value) {
@@ -93,28 +123,33 @@ public final class TmfFixedArray<T> extends AbstractList<T> implements RandomAcc
         System.arraycopy(value.fArray, 0, result.fArray, fArray.length, value.fArray.length);
         return result;
     }
+
     /**
      * Append in order many FixedArray to this FixedArray.
-     * @param values The FixedArrays to append.
+     *
+     * @param values
+     *            The FixedArrays to append.
      * @return A new FixedArray with the element of all the FixedArray.
      */
     public TmfFixedArray<T> append(final TmfFixedArray<T>... values) {
         int newLength = 0;
-        for(TmfFixedArray<T> value : values) {
+        for (TmfFixedArray<T> value : values) {
             newLength += value.size();
         }
                 TmfFixedArray<T> result = new TmfFixedArray<T>(copyOf(fArray, fArray.length + newLength));
         newLength = fArray.length;
-        for(TmfFixedArray<T> value : values)
-        {
+        for (TmfFixedArray<T> value : values) {
             System.arraycopy(value.fArray, 0, result.fArray, newLength, value.fArray.length);
             newLength += value.fArray.length;
         }
         return result;
     }
+
     /**
      * Append an element to the array.
-     * @param value Element to append.
+     *
+     * @param value
+     *            Element to append.
      * @return A new FixedArray with the element appended.
      */
     public TmfFixedArray<T> append(final T value) {
@@ -122,72 +157,86 @@ public final class TmfFixedArray<T> extends AbstractList<T> implements RandomAcc
         result.set(fArray.length, value);
         return result;
     }
+
     /**
      * Append an array of element to the array.
-     * @param values Elements array to append.
+     *
+     * @param values
+     *            Elements array to append.
      * @return A new FixedArray with the elements appended.
      */
     public TmfFixedArray<T> append(final T... values) {
         TmfFixedArray<T> result = new TmfFixedArray<T>(copyOf(fArray, fArray.length + values.length));
-        for(int i = 0; i < values.length; ++i) {
+        for (int i = 0; i < values.length; ++i) {
             result.set(fArray.length + i, values[i]);
         }
         return result;
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.lang.Object#clone()
      */
     @Override
-    public Object clone()
-    {
+    public Object clone() {
         return new TmfFixedArray<T>(copyOf(fArray, fArray.length));
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractList#equals(java.lang.Object)
      */
     @Override
     public boolean equals(Object o) {
-        if(o instanceof TmfFixedArray<?>) {
-            return Arrays.equals(fArray, ((TmfFixedArray<?>)o).fArray);
+        if (o instanceof TmfFixedArray<?>) {
+            return Arrays.equals(fArray, ((TmfFixedArray<?>) o).fArray);
         }
-        if(!(o instanceof List)) {
+        if (!(o instanceof List)) {
             return false;
         }
-        for(int i = 0; i < fArray.length; ++i) {
-            if(!fArray[i].equals(o)) {
+        for (int i = 0; i < fArray.length; ++i) {
+            if (!fArray[i].equals(o)) {
                 return false;
             }
         }
         return true;
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractList#get(int)
      */
     @Override
     public T get(int index) {
         return fArray[index];
     }
+
     /**
      * Get the array reference.
+     *
      * @return The array reference.
      * @see #toArray FixedArray.toArray() to get a copy of the array.
      */
     public T[] getArray() {
         return fArray;
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractList#hashCode()
      */
     @Override
     public int hashCode() {
         return Arrays.hashCode(fArray);
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractList#set(int, java.lang.Object)
      */
     @Override
@@ -196,58 +245,71 @@ public final class TmfFixedArray<T> extends AbstractList<T> implements RandomAcc
         fArray[index] = element;
         return temp;
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractCollection#size()
      */
     @Override
     public int size() {
         return fArray.length;
     }
+
     /**
      * Get a array covering only a part of the array.
-     * @param start Starting position of the new array.
+     *
+     * @param start
+     *            Starting position of the new array.
      * @return A new array covering the elements specified.
      */
     public TmfFixedArray<T> subArray(int start) {
         return new TmfFixedArray<T>(copyOfRange(fArray, start, fArray.length));
     }
+
     /**
      * Get a array covering only a part of the array.
-     * @param start Starting position of the new array.
-     * @param length Number of element to include in the new array.
+     *
+     * @param start
+     *            Starting position of the new array.
+     * @param length
+     *            Number of element to include in the new array.
      * @return A new array covering the elements specified.
      */
     public TmfFixedArray<T> subArray(int start, int length) {
         return new TmfFixedArray<T>(copyOfRange(fArray, start, length + start));
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractCollection#toArray()
      */
     @Override
-    public T[] toArray()
-    {
+    public T[] toArray() {
         return copyOf(fArray, fArray.length);
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractCollection#toArray(T[])
      */
     @Override
-    public <E> E[] toArray(E[] array)
-    {
-        if(array.length < fArray.length) {
-            return copyOf(fArray, fArray.length,(Class<? extends E[]>)array.getClass());
+    public <E> E[] toArray(E[] array) {
+        if (array.length < fArray.length) {
+            return copyOf(fArray, fArray.length, (Class<? extends E[]>) array.getClass());
         }
         System.arraycopy(fArray, 0, array, 0, fArray.length);
-        if(array.length > fArray.length) {
+        if (array.length > fArray.length) {
             array[fArray.length] = null;
         }
         return array;
     }
+
     /*
      * (non-Javadoc)
+     *
      * @see java.util.AbstractCollection#toString()
      */
     @Override
index 6a590ae4583de54af06411fe12a5d4ab918607a6..2759bf61e68eec1fa8e8e113bfc7b4462604e254 100644 (file)
@@ -9,7 +9,7 @@
  * Contributors:
  *   Bernd Hufmann - Initial API and implementation
  *   Bernd Hufmann - Add UML2SD tests
- *   Mathieu Denis (mathieu.denis@polymtl.ca) - Add Statistics test
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Add Statistics test
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.tests;
@@ -19,7 +19,7 @@ import junit.framework.TestSuite;
 
 /**
  * <b><u>AllTmfUITests</u></b>
- * <p>
+ *
  * Master test suite for TMF UI Core.
  */
 public class AllTmfUITests {
@@ -27,15 +27,15 @@ public class AllTmfUITests {
     /**
      * @return the TMF UI test suite
      */
-       public static Test suite() {
-               TestSuite suite = new TestSuite(AllTmfUITests.class.getName());
-               //$JUnit-BEGIN$
-               suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.statistics.AllTests.suite());
+    public static Test suite() {
+        TestSuite suite = new TestSuite(AllTmfUITests.class.getName());
+        // $JUnit-BEGIN$
+        suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.statistics.AllTests.suite());
         suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.views.uml2sd.dialogs.AllTests.suite());
         suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.views.uml2sd.loader.AllTests.suite());
         suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.views.uml2sd.load.AllTests.suite());
         suite.addTest(org.eclipse.linuxtools.tmf.ui.tests.histogram.AllTests.suite());
-               //$JUnit-END$
-               return suite;
-       }
+        // $JUnit-END$
+        return suite;
+    }
 }
index e9f82de763ab919dc3d06150f4f267e98be41dc6..8d8ce22159df39462d965cffc3e96c4a107a3dfb 100644 (file)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca) - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *   Bernd Hufmann - Fixed suite name
  *******************************************************************************/
 package org.eclipse.linuxtools.tmf.ui.tests.statistics;
@@ -24,16 +24,16 @@ public class AllTests {
     /**
      * @return the test suite
      */
-       public static Test suite() {
-               TestSuite suite = new TestSuite(AllTests.class.getName());
-               //$JUnit-BEGIN$
-               suite.addTestSuite(TmfBaseColumnDataProviderTest.class);
-               suite.addTestSuite(TmfBaseColumnDataTest.class);
-               suite.addTestSuite(TmfBaseStatisticsDataTest.class);
-               suite.addTestSuite(TmfStatisticsTreeNodeTest.class);
-               suite.addTestSuite(TmfStatisticsTreeRootFactoryTest.class);
-               suite.addTestSuite(TmfTreeContentProviderTest.class);
-               //$JUnit-END$
-               return suite;
-       }
-}
\ No newline at end of file
+    public static Test suite() {
+        TestSuite suite = new TestSuite(AllTests.class.getName());
+        // $JUnit-BEGIN$
+        suite.addTestSuite(TmfBaseColumnDataProviderTest.class);
+        suite.addTestSuite(TmfBaseColumnDataTest.class);
+        suite.addTestSuite(TmfBaseStatisticsDataTest.class);
+        suite.addTestSuite(TmfStatisticsTreeNodeTest.class);
+        suite.addTestSuite(TmfStatisticsTreeRootFactoryTest.class);
+        suite.addTestSuite(TmfTreeContentProviderTest.class);
+        // $JUnit-END$
+        return suite;
+    }
+}
index 8e35d7a37241eedaa0ac45c3ed9ef71ee0ba77b9..58aafde9cad3d34a8cbaec00bce51801140c2914 100644 (file)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca) - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *   Bernd Hufmann - Fixed header and warnings
  *******************************************************************************/
 package org.eclipse.linuxtools.tmf.ui.tests.statistics;
@@ -62,7 +62,7 @@ public class TmfBaseColumnDataProviderTest extends TestCase {
     private final TmfTimestamp fTimestamp2 = new TmfTimestamp(12350, (byte) 2, 5);
     private final TmfTimestamp fTimestamp3 = new TmfTimestamp(12355, (byte) 2, 5);
 
-    private final String       fSource = "Source";
+    private final String fSource = "Source";
 
     private final TmfEventType fType1 = new TmfEventType(fContext, fTypeId1, TmfEventField.makeRoot(fLabels));
     private final TmfEventType fType2 = new TmfEventType(fContext, fTypeId1, TmfEventField.makeRoot(fLabels));
@@ -169,4 +169,4 @@ public class TmfBaseColumnDataProviderTest extends TestCase {
             }
         }
     }
-}
\ No newline at end of file
+}
index 3f4f60b267ce7766995d545d281b9613126993dc..a123c4118f7cada558d461f88addd04e6564eae4 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.tests.statistics;
index d955b9b8b32ad626a6bfd57533193c870bf86f04..7e7ebb28f5c99bfdd66a3c7143c45e1c09345eb1 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *   Bernd Hufmann - Fixed warnings
  *******************************************************************************/
 
@@ -40,7 +40,7 @@ public class TmfBaseStatisticsDataTest extends TestCase {
     // ------------------------------------------------------------------------
     // Fields
     // ------------------------------------------------------------------------
-    private       String   fTestName = null;
+    private       String fTestName = null;
 
     private final String fContext = "UnitTest";
     private final String fTypeId1 = "Some type1";
@@ -80,7 +80,8 @@ public class TmfBaseStatisticsDataTest extends TestCase {
     // ------------------------------------------------------------------------
 
     /**
-     * @param name of the test
+     * @param name
+     *            Test name
      */
     public TmfBaseStatisticsDataTest(final String name) {
         super(name);
@@ -141,8 +142,7 @@ public class TmfBaseStatisticsDataTest extends TestCase {
             temp = iterChild.next();
             if (keyExpected.contains(temp.getKey())) {
                 keyExpected.removeElement(temp.getKey());
-            }
-            else {
+            } else {
                 fail();
             }
         }
@@ -175,7 +175,10 @@ public class TmfBaseStatisticsDataTest extends TestCase {
         Vector<String> keyExpected = new Vector<String>();
         keyExpected.add(fEvent1.getType().toString());
         keyExpected.add(fEvent3.getType().toString());
-        // It should return the eventType even though the number of events equals 0
+        /*
+         * It should return the eventType even though the number of events
+         * equals 0
+         */
         fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString())).reset();
         // Getting children of a category
         childrenTreeNode = fStatsData.get(treeNode.getPath()).getAllChildren();
@@ -187,8 +190,7 @@ public class TmfBaseStatisticsDataTest extends TestCase {
             temp = iterChild.next();
             if (keyExpected.contains(temp.getKey())) {
                 keyExpected.removeElement(temp.getKey());
-            }
-            else {
+            } else {
                 fail();
             }
         }
@@ -213,8 +215,7 @@ public class TmfBaseStatisticsDataTest extends TestCase {
         for (TmfStatisticsTreeNode child : childrenTreeNode) {
             if (child.getKey().compareTo(fEvent1.getType().toString()) == 0) {
                 assertEquals("registerEvent", 2, child.getValue().nbEvents);
-            }
-            else if (child.getKey().compareTo(fEvent3.getType().toString()) == 0) {
+            } else if (child.getKey().compareTo(fEvent3.getType().toString()) == 0) {
                 assertEquals("registerEvent", 1, child.getValue().nbEvents);
             }
         }
index c0ec628953be658e3dd6cc0bcfa1b10e4577c4cc..c9d3d7143da0ffae836302467830d86b893b057f 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *   Bernd Hufmann - Fixed warnings
  *******************************************************************************/
 
@@ -81,7 +81,8 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
     // ------------------------------------------------------------------------
 
     /**
-     * @param name of the test
+     * @param name
+     *            Test name
      */
     public TmfStatisticsTreeNodeTest(final String name) {
         super(name);
@@ -122,16 +123,16 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         // Creates a category from the key already created
         TmfStatisticsTreeNode catNode = traceNode.getChildren().iterator().next();
 
-        assertTrue("containsChild",  rootNode.containsChild(fTestName));
+        assertTrue("containsChild", rootNode.containsChild(fTestName));
         assertFalse("containsChild", rootNode.containsChild(catNode.getKey()));
         assertFalse("containsChild", rootNode.containsChild(null));
 
-        assertTrue("containsChild",  traceNode.containsChild(catNode.getKey()));
+        assertTrue("containsChild", traceNode.containsChild(catNode.getKey()));
         assertFalse("containsChild", traceNode.containsChild(fEvent1.getType().toString()));
         assertFalse("containsChild", traceNode.containsChild(null));
 
-        assertTrue("containsChild",  catNode.containsChild(fEvent1.getType().toString()));
-        assertTrue("containsChild",  catNode.containsChild(fEvent3.getType().toString()));
+        assertTrue("containsChild", catNode.containsChild(fEvent1.getType().toString()));
+        assertTrue("containsChild", catNode.containsChild(fEvent3.getType().toString()));
         assertFalse("containsChild", catNode.containsChild(null));
     }
 
@@ -168,8 +169,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
             temp = iterChild.next();
             if (keyExpected.contains(temp.getKey())) {
                 keyExpected.removeElement(temp.getKey());
-            }
-            else {
+            } else {
                 fail();
             }
         }
@@ -202,7 +202,10 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         Vector<String> keyExpected = new Vector<String>();
         keyExpected.add(fEvent1.getType().toString());
         keyExpected.add(fEvent3.getType().toString());
-        // It should return the eventType even though the number of events equals 0
+        /*
+         * It should return the eventType even though the number of events
+         * equals 0
+         */
         fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString())).reset();
         // Getting children of a category
         childrenTreeNode = treeNode.getAllChildren();
@@ -214,8 +217,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
             temp = iterChild.next();
             if (keyExpected.contains(temp.getKey())) {
                 keyExpected.removeElement(temp.getKey());
-            }
-            else {
+            } else {
                 fail();
             }
         }
@@ -228,6 +230,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
     // ------------------------------------------------------------------------
     // GetNbChildren
     // ------------------------------------------------------------------------
+
     /**
      * Test getting of number of children.
      */
@@ -237,9 +240,9 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         TmfStatisticsTreeNode catNode     = traceNode.getChildren().iterator().next();
         TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
 
-        assertEquals("getNbChildren", 1,    rootNode.getNbChildren());
-        assertEquals("getNbChildren", 1,   traceNode.getNbChildren());
-        assertEquals("getNbChildren", 2,     catNode.getNbChildren());
+        assertEquals("getNbChildren", 1, rootNode.getNbChildren());
+        assertEquals("getNbChildren", 1, traceNode.getNbChildren());
+        assertEquals("getNbChildren", 2, catNode.getNbChildren());
         assertEquals("getNbChildren", 0, elementNode.getNbChildren());
     }
 
@@ -256,9 +259,9 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         TmfStatisticsTreeNode catNode     = traceNode.getChildren().iterator().next();
         TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
 
-        assertTrue ("hasChildren",    rootNode.hasChildren());
-        assertTrue ("hasChildren",   traceNode.hasChildren());
-        assertTrue ("hasChildren",     catNode.hasChildren());
+        assertTrue("hasChildren", rootNode.hasChildren());
+        assertTrue("hasChildren", traceNode.hasChildren());
+        assertTrue("hasChildren", catNode.hasChildren());
         assertFalse("hasChildren", elementNode.hasChildren());
     }
 
@@ -305,6 +308,7 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
     // ------------------------------------------------------------------------
     // GetKey
     // ------------------------------------------------------------------------
+
     /**
      * Test getting of key.
      */
@@ -314,9 +318,9 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         TmfStatisticsTreeNode catNode     = traceNode.getChildren().iterator().next();
         TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
 
-        assertEquals("getKey", 0,    rootNode.getKey().compareTo(AbsTmfStatisticsTree.ROOT.get(0)));
-        assertEquals("getKey", 0,   traceNode.getKey().compareTo(fTestName));
-        assertEquals("getKey", 0,     catNode.getKey().compareTo(Messages.TmfStatisticsData_EventTypes));
+        assertEquals("getKey", 0, rootNode.getKey().compareTo(AbsTmfStatisticsTree.ROOT.get(0)));
+        assertEquals("getKey", 0, traceNode.getKey().compareTo(fTestName));
+        assertEquals("getKey", 0, catNode.getKey().compareTo(Messages.TmfStatisticsData_EventTypes));
         assertEquals("getKey", 0, elementNode.getKey().compareTo(fEvent1.getType().toString()));
     }
 
@@ -333,9 +337,9 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         TmfStatisticsTreeNode catNode     = traceNode.getChildren().iterator().next();
         TmfStatisticsTreeNode elementNode = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
 
-        assertTrue("getPath",    rootNode.getPath().equals(AbsTmfStatisticsTree.ROOT));
-        assertTrue("getPath",   traceNode.getPath().equals(new TmfFixedArray<String>(fTestName)));
-        assertTrue("getPath",     catNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes)));
+        assertTrue("getPath", rootNode.getPath().equals(AbsTmfStatisticsTree.ROOT));
+        assertTrue("getPath", traceNode.getPath().equals(new TmfFixedArray<String>(fTestName)));
+        assertTrue("getPath", catNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes)));
         assertTrue("getPath", elementNode.getPath().equals(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString())));
     }
 
@@ -353,9 +357,9 @@ public class TmfStatisticsTreeNodeTest extends TestCase {
         TmfStatisticsTreeNode elementNode1 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent1.getType().toString()));
         TmfStatisticsTreeNode elementNode2 = fStatsData.get(new TmfFixedArray<String>(fTestName, Messages.TmfStatisticsData_EventTypes, fEvent3.getType().toString()));
 
-        assertEquals("getValue", 0,     rootNode.getValue().nbEvents);
-        assertEquals("getValue", 3,    traceNode.getValue().nbEvents);
-        assertEquals("getValue", 0,      catNode.getValue().nbEvents);
+        assertEquals("getValue", 0, rootNode.getValue().nbEvents);
+        assertEquals("getValue", 3, traceNode.getValue().nbEvents);
+        assertEquals("getValue", 0, catNode.getValue().nbEvents);
         assertEquals("getValue", 2, elementNode1.getValue().nbEvents);
         assertEquals("getValue", 1, elementNode2.getValue().nbEvents);
     }
index ae7b5240e1459c0be5feb4e55d747fb59cf00bf7..ca8512c027603f6e2946fc7017634fb7002b1af8 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *   Bernd Hufmann - Fixed warnings
  *******************************************************************************/
 
index 82ba6ffdeecbf4bd38ed06ee22ce5cd14c77bf00..8f81c9e168be044c087055353cf9b60aa7436769 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *   Bernd Hufmann - Fixed warnings
  *******************************************************************************/
 
index a8cd5640aeb087ee781e7a9fcc04c603ff1c5f80..0ebc8c378357a9fd5358db2cb6dba4146274964a 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis (mathieu.denis@polymtl.ca)  - Initial design and implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial design and implementation
  *   Bernd Hufmann - Changed interface and class name
  *******************************************************************************/
 
@@ -24,6 +24,7 @@ public interface ITmfExtraEventInfo {
 
     /**
      * Returns the trace name.
+     *
      * @return the name of the trace.
      */
     public String getTraceName();
index 62656f827a6659435e3a889ff9989ab567ed0702..2fd8caecde1cde3c123b25b9a7250a162042dbf0 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics;
index e9f39504525363fcd21e85e025e1aeb807e79036..73d8eb64162f84ce8e42f7ba23e44d74798110f5 100755 (executable)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 20112 Ericsson
+ * Copyright (c) 2011, 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
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis  (mathieu.denis@polymtl.ca)  - Generalized version based on LTTng
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Generalized version based on LTTng
  *   Bernd Hufmann - Updated to use trace reference in TmfEvent and streaming
  *
  *******************************************************************************/
@@ -56,66 +56,84 @@ import org.eclipse.swt.widgets.Listener;
 /**
  * The generic Statistics View displays statistics for any kind of traces.
  *
- * It is implemented according to the MVC pattern. - The model is a TmfStatisticsTreeNode built by the State Manager. - The view is built with a
- * TreeViewer. - The controller that keeps model and view synchronized is an observer of the model.
- * </p>
+ * It is implemented according to the MVC pattern. - The model is a
+ * TmfStatisticsTreeNode built by the State Manager. - The view is built with a
+ * TreeViewer. - The controller that keeps model and view synchronized is an
+ * observer of the model.
  *
  * @version 1.0
- * @author @author Mathieu Denis
+ * @author Mathieu Denis
  */
 public class TmfStatisticsView extends TmfView {
+
     /**
      * The ID correspond to the package in which this class is embedded
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.statistics"; //$NON-NLS-1$
+
     /**
-     *  The view name.
+     * The view name.
      */
     public static final String TMF_STATISTICS_VIEW = "StatisticsView"; //$NON-NLS-1$
+
     /**
-     *  Refresh frequency
+     * Refresh frequency
      */
     protected static final Long STATS_INPUT_CHANGED_REFRESH = 5000L;
+
     /**
-     *  Default PAGE_SIZE for background requests
+     * Default PAGE_SIZE for background requests
      */
     protected static final int PAGE_SIZE = 50000;
+
     /**
-     *  The actual tree viewer to display
+     * The actual tree viewer to display
      */
     protected TreeViewer fTreeViewer;
+
     /**
-     *  Stores the request to the experiment
+     * Stores the global request to the experiment
      */
     protected ITmfEventRequest fRequest = null;
+
     /**
-     *  Update synchronization parameter (used for streaming): Update busy indicator
+     * Update synchronization parameter (used for streaming): Update busy
+     * indicator
      */
     protected boolean fStatisticsUpdateBusy = false;
+
     /**
-     *  Update synchronization parameter (used for streaming): Update pending indicator
+     * Update synchronization parameter (used for streaming): Update pending
+     * indicator
      */
     protected boolean fStatisticsUpdatePending = false;
+
     /**
-     *  Update synchronization parameter (used for streaming): Pending Update time range
+     * Update synchronization parameter (used for streaming): Pending Update
+     * time range
      */
     protected TmfTimeRange fStatisticsUpdateRange = null;
+
     /**
      * Update synchronization object.
      */
     protected final Object fStatisticsUpdateSyncObj = new Object();
+
     /**
-     *  Flag to force request the data from trace
+     * Flag to force request the data from trace
      */
     protected boolean fRequestData = false;
+
     /**
-     *  Object to store the cursor while waiting for the experiment to load
+     * Object to store the cursor while waiting for the experiment to load
      */
     private Cursor fWaitCursor = null;
+
     /**
-     *  View instance counter (for multiple statistic views)
+     * View instance counter (for multiple statistic views)
      */
     private static int fCountInstance = 0;
+
     /**
      * Number of this instance. Used as an instance ID.
      */
@@ -142,7 +160,9 @@ public class TmfStatisticsView extends TmfView {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+     *
+     * @see
+     * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
      */
     @Override
     public void createPartControl(Composite parent) {
@@ -231,11 +251,12 @@ public class TmfStatisticsView extends TmfView {
             // Insert the statistics data into the tree
             TmfExperimentSelectedSignal signal = new TmfExperimentSelectedSignal(this, experiment);
             experimentSelected(signal);
-         }
+        }
     }
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.TmfView#dispose()
      */
     @Override
@@ -245,7 +266,10 @@ public class TmfStatisticsView extends TmfView {
             fWaitCursor.dispose();
         }
 
-        // Make sure there is no request running before removing the statistics tree
+        /*
+         * Make sure there is no request running before removing the statistics
+         * tree
+         */
         cancelOngoingRequest();
         // clean the model
         TmfStatisticsTreeRootFactory.removeAll();
@@ -253,6 +277,7 @@ public class TmfStatisticsView extends TmfView {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
      */
     @Override
@@ -290,13 +315,16 @@ public class TmfStatisticsView extends TmfView {
      * Called when an experiment request has failed or has been cancelled.
      * Remove the data retrieved from the experiment from the statistics tree.
      *
-     * @param name The experiment name
+     * @param name
+     *            The experiment name
      */
     public void modelIncomplete(String name) {
         Object input = fTreeViewer.getInput();
         if (input != null && input instanceof TmfStatisticsTreeNode) {
-            // The data from this experiment is invalid and shall be removed to
-            // refresh upon next selection
+            /*
+             * The data from this experiment is invalid and shall be removed to
+             * refresh upon next selection
+             */
             TmfStatisticsTreeRootFactory.removeStatTreeRoot(getTreeID(name));
 
             // Reset synchronization information
@@ -309,7 +337,8 @@ public class TmfStatisticsView extends TmfView {
     /**
      * Handles the signal about disposal of the current experiment.
      *
-     * @param signal The disposed signal
+     * @param signal
+     *            The disposed signal
      */
     @TmfSignalHandler
     public void experimentDisposed(TmfExperimentDisposedSignal signal) {
@@ -320,10 +349,12 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Handler called when an experiment is selected. Checks if the experiment has changed
-     * and requests the selected experiment if it has not yet been cached.
+     * Handler called when an experiment is selected. Checks if the experiment
+     * has changed and requests the selected experiment if it has not yet been
+     * cached.
      *
-     * @param signal Contains the information about the selection.
+     * @param signal
+     *            Contains the information about the selection.
      */
     @TmfSignalHandler
     public void experimentSelected(TmfExperimentSelectedSignal signal) {
@@ -343,8 +374,10 @@ public class TmfStatisticsView extends TmfView {
 
                 if (numTraces == numNodeTraces) {
                     boolean same = true;
-                    // Detect if the experiment contains the same traces as when
-                    // previously selected
+                    /*
+                     * Detect if the experiment contains the same traces as when
+                     * previously selected
+                     */
                     for (int i = 0; i < numTraces; i++) {
                         String traceName = traces[i].getName();
                         if (!experimentTreeNode.containsChild(traceName)) {
@@ -388,13 +421,15 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Handles the signal about new experiment range.
-     * @param signal The experiment range updated signal
+     *
+     * @param signal
+     *            The experiment range updated signal
      */
     @TmfSignalHandler
     public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) {
         TmfExperiment experiment = signal.getExperiment();
         // validate
-        if (! experiment.equals(TmfExperiment.getCurrentExperiment())) {
+        if (!experiment.equals(TmfExperiment.getCurrentExperiment())) {
             return;
         }
 
@@ -402,16 +437,18 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Handles the experiment updated signal. This will detect new events
-     * in case the indexing is not coalesced with a statistics request.
-     * @param signal The experiment updated signal
+     * Handles the experiment updated signal. This will detect new events in
+     * case the indexing is not coalesced with a statistics request.
+     *
+     * @param signal
+     *            The experiment updated signal
      *
      * @since 1.1
      */
     @TmfSignalHandler
     public void experimentUpdated(TmfExperimentUpdatedSignal signal) {
         TmfExperiment experiment = signal.getExperiment();
-        if (! experiment.equals(TmfExperiment.getCurrentExperiment())) {
+        if (!experiment.equals(TmfExperiment.getCurrentExperiment())) {
             return;
         }
 
@@ -420,9 +457,11 @@ public class TmfStatisticsView extends TmfView {
             nbEvents += (int) node.getValue().nbEvents;
         }
 
-        // In the normal case, the statistics request is coalesced with indexing
-        // and the number of events are the same, there is nothing to do.
-        // But if its not the case, trigger a new request to count the new events.
+        /*
+         * In the normal case, the statistics request is coalesced with indexing
+         * and the number of events are the same, there is nothing to do. But if
+         * it's not the case, trigger a new request to count the new events.
+         */
         if (nbEvents < experiment.getNbEvents()) {
             requestData(experiment, experiment.getTimeRange());
         }
@@ -438,16 +477,19 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Returns the quantity of data to retrieve before a refresh of the view is performed
+     * Returns the quantity of data to retrieve before a refresh of the view is
+     * performed
      *
-     * @return the quantity of data to retrieve before a refresh of the view is performed.
+     * @return the quantity of data to retrieve before a refresh of the view is
+     *         performed.
      */
     protected long getInputChangedRefresh() {
         return STATS_INPUT_CHANGED_REFRESH;
     }
 
     /**
-     * This method can be overridden to implement another way to represent the statistics data and to retrieve the information for display.
+     * This method can be overridden to implement another way to represent the
+     * statistics data and to retrieve the information for display.
      *
      * @return a TmfStatisticsData object.
      */
@@ -456,7 +498,8 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * This method can be overridden to change the representation of the data in the columns.
+     * This method can be overridden to change the representation of the data in
+     * the columns.
      *
      * @return an object implementing ITmfBaseColumnDataProvider.
      */
@@ -465,9 +508,11 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Constructs the ID based on the experiment name and <code>fInstanceNb</code>
+     * Constructs the ID based on the experiment name and
+     * <code>fInstanceNb</code>
      *
-     * @param experimentName the name of the trace name to show in the view
+     * @param experimentName
+     *            the name of the trace name to show in the view
      * @return a view ID
      */
     protected String getTreeID(String experimentName) {
@@ -475,9 +520,12 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * When the experiment is loading the cursor will be different so the user know the processing is not finished yet.
+     * When the experiment is loading the cursor will be different so the user
+     * knows the processing is not finished yet.
      *
-     * @param waitInd Indicates if we need to show the waiting cursor, or the default one
+     * @param waitInd
+     *            Indicates if we need to show the waiting cursor, or the
+     *            default one
      */
     protected void waitCursor(final boolean waitInd) {
         if ((fTreeViewer == null) || (fTreeViewer.getTree().isDisposed())) {
@@ -493,7 +541,8 @@ public class TmfStatisticsView extends TmfView {
         display.asyncExec(new Runnable() {
             @Override
             public void run() {
-                if ((fTreeViewer != null) && (!fTreeViewer.getTree().isDisposed())) {
+                if ((fTreeViewer != null)
+                        && (!fTreeViewer.getTree().isDisposed())) {
                     Cursor cursor = null; /* indicates default */
                     if (waitInd) {
                         cursor = fWaitCursor;
@@ -505,15 +554,18 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Perform the request for an experiment and populates the statistics tree with event.
+     * Perform the request for an experiment and populates the statistics tree
+     * with events.
      *
-     * @param experiment experiment for which we need the statistics data.
-     * @param timeRange to request
+     * @param experiment
+     *            Experiment for which we need the statistics data.
+     * @param timeRange
+     *            to request
      */
     protected void requestData(final TmfExperiment experiment, TmfTimeRange timeRange) {
         if (experiment != null) {
 
-            // Check if update is already ongoing
+            // Check if an update is already ongoing
             if (checkUpdateBusy(timeRange)) {
                 return;
             }
@@ -596,16 +648,19 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Checks if statistic update is ongoing. If it is ongoing the new time range is stored as pending
+     * Checks if statistic update is ongoing. If it is ongoing the new time
+     * range is stored as pending
      *
-     * @param timeRange - new time range
+     * @param timeRange
+     *            - new time range
      * @return true if statistic update is ongoing else false
      */
     protected boolean checkUpdateBusy(TmfTimeRange timeRange) {
         synchronized (fStatisticsUpdateSyncObj) {
             if (fStatisticsUpdateBusy) {
                 fStatisticsUpdatePending = true;
-                if (fStatisticsUpdateRange == null || timeRange.getEndTime().compareTo(fStatisticsUpdateRange.getEndTime()) > 0) {
+                if (fStatisticsUpdateRange == null
+                        || timeRange.getEndTime().compareTo(fStatisticsUpdateRange.getEndTime()) > 0) {
                     fStatisticsUpdateRange = timeRange;
                 }
                 return true;
index 79efa68d189a3180c555b6e5325b8ba92d10811b..e268f3c6e0ed2e4dc78ae2b79ee5fde7579151b2 100755 (executable)
@@ -23,28 +23,27 @@ import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
 
 /**
- * <h4>Base class for the statistics storage.</h4>
- * <p>
- * It allow to implement a tree structure while avoiding the need to run through
- * the tree each time you need to add a node at a given place.
- * </p>
+ * Base class for the statistics storage. It allow to implement a tree structure
+ * while avoiding the need to run through the tree each time you need to add a
+ * node at a given place.
  *
- *  @version 1.0
- *  @author Mathieu Denis
+ * @version 1.0
+ * @author Mathieu Denis
  */
 public abstract class AbsTmfStatisticsTree {
 
     /**
-     * <h4>String builder used to merge string with more efficacy.</h4>
+     * String builder used to merge string with more efficiency.
      */
     protected static final StringBuilder fBuilder = new StringBuilder();
+
     /**
-     * <h4>Identification of the root.</h4>
+     * Identification of the root.
      */
     public static final TmfFixedArray<String> ROOT = new TmfFixedArray<String>("root"); //$NON-NLS-1$
 
     /**
-     * <h4>Function to merge many string with more efficacy.</h4>
+     * Function to merge many string with more efficiency.
      *
      * @param strings
      *            Strings to merge.
@@ -55,26 +54,22 @@ public abstract class AbsTmfStatisticsTree {
         for (String s : strings) {
             fBuilder.append(s);
         }
-                return fBuilder.toString();
+        return fBuilder.toString();
     }
 
     /**
-     * <h4>Define what child a node can have.</h4>
-     * <p>
-     * The management and usage of this map is done by subclass.
-     * </p>
-     * <p>
-     * HashSet are always faster than TreeSet.
-     * </p>
+     * Define what children a node can have. The management and usage of this map
+     * is done by subclasses. HashSet are always faster than TreeSet for String keys.
      */
     protected Map<String, Set<String>> fKeys;
+
     /**
-     * <h4>The nodes in the tree.</f4>
+     * The nodes in the tree.
      */
     protected HashMap<TmfFixedArray<String>, TmfStatisticsTreeNode> fNodes;
 
     /**
-     * <h4>Constructor.</h4>
+     * Constructor.
      */
     public AbsTmfStatisticsTree() {
         fNodes = new HashMap<TmfFixedArray<String>, TmfStatisticsTreeNode>();
@@ -82,7 +77,7 @@ public abstract class AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get a node.</h4>
+     * Get a node.
      *
      * @param path
      *            Path to the node.
@@ -93,7 +88,7 @@ public abstract class AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get the children of a node.</h4>
+     * Get the children of a node.
      *
      * @param path
      *            Path to the node.
@@ -102,7 +97,8 @@ public abstract class AbsTmfStatisticsTree {
     public abstract Collection<TmfStatisticsTreeNode> getChildren(final TmfFixedArray<String> path);
 
     /**
-     * <h4>Get every children of a node, even if it doesn't have any registered events, as opposed to getChildren</h4>
+     * Get every children of a node, even if it doesn't have any registered
+     * events, as opposed to getChildren
      *
      * @param path
      *            Path to the node.
@@ -111,7 +107,7 @@ public abstract class AbsTmfStatisticsTree {
     public abstract Collection<TmfStatisticsTreeNode> getAllChildren(final TmfFixedArray<String> path);
 
     /**
-     * <h4>Get the map of existing elements of path classified by parent.</h4>
+     * Get the map of existing elements of path classified by parent.
      *
      * @return The map.
      */
@@ -120,7 +116,7 @@ public abstract class AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get or create a node.</h4>
+     * Get or create a node.
      *
      * @param path
      *            Path to the node.
@@ -137,7 +133,7 @@ public abstract class AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get the parent of a node.</h4>
+     * Get the parent of a node.
      *
      * @param path
      *            Path to the node.
@@ -154,10 +150,10 @@ public abstract class AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Increase any kind of counter.</h4>
-     * <p>
-     * This method must be implemented by subclass.
-     * </p>
+     * Increase any kind of counter.
+     *
+     * This method must be implemented by subclasses.
+     *
      * @param event
      *            Current event.
      * @param extraInfo
@@ -168,10 +164,10 @@ public abstract class AbsTmfStatisticsTree {
     public abstract void increase(ITmfEvent event, ITmfExtraEventInfo extraInfo, int values);
 
     /**
-     * <h4>Register an event.</h4>
-     * <p>
-     * This method must be implemented by subclass.
-     * </p>
+     * Register an event.
+     *
+     * This method must be implemented by subclasses.
+     *
      * @param event
      *            Current event.
      * @param extraInfo
@@ -180,11 +176,10 @@ public abstract class AbsTmfStatisticsTree {
     public abstract void registerEvent(ITmfEvent event, ITmfExtraEventInfo extraInfo);
 
     /**
-     * <h4>Register that a new node was created.</h4>
-     * <p>
+     * Register that a new node was created.
+     *
      * Must make sure the {@link #getChildren(TmfFixedArray)} on the parent node
      * will return the newly created node.
-     * </p>
      *
      * @param path
      *            Path of the new node.
@@ -192,10 +187,9 @@ public abstract class AbsTmfStatisticsTree {
     protected abstract void registerName(final TmfFixedArray<String> path);
 
     /**
-     * <h4>Reset a node.</h4>
-     * <p>
+     * Reset a node.
+     *
      * Work recursively.
-     * </p>
      *
      * @param path
      *            Path to the node.
index 6e06be41792a9b3e414c5e8c45d5d20b2b6ed89f..35cd206dfe0e4da31a1148cfee27c76003285bb1 100755 (executable)
@@ -1,13 +1,13 @@
 /*******************************************************************************
  * Copyright (c) 2011, 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
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -15,16 +15,18 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
 import java.util.List;
 
 /**
- * Basic methods that must be implemented in a column data provider.
- * The <code>TmfStatisticsView</code> uses classes implementing this
- * interface to define the columns in the statistics tree viewer. 
- * 
+ * Basic methods that must be implemented in a column data provider. The
+ * <code>TmfStatisticsView</code> uses classes implementing this interface to
+ * define the columns in the statistics tree viewer.
+ *
  * @version 1.0
  * @author Mathieu Denis
  */
 public interface ITmfColumnDataProvider {
+
     /**
      * Return a list of the column created for the view
+     *
      * @return columns list
      */
     public List<TmfBaseColumnData> getColumnData();
index 59043d8d3ded1805045c912fdc42491f61f348d8..236423aab01968105f60e560e2a4dde7036607d4 100644 (file)
@@ -1,13 +1,13 @@
 /*******************************************************************************
  * Copyright (c) 2011, 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
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -17,53 +17,63 @@ import org.eclipse.jface.viewers.ViewerComparator;
 import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseColumnData.ITmfColumnPercentageProvider;
 
 /**
- * Provide the basic interface to create a statistics column for the statistics table tree.
- * 
- *  @version 1.0
- *  @author Mathieu Denis
+ * Provide the basic interface to create a statistics column for the statistics
+ * table tree.
+ *
+ * @version 1.0
+ * @author Mathieu Denis
  */
 public interface ITmfStatisticsColumnData {
 
     /**
      * Return the column name.
+     *
      * @return the name of the column.
      */
     public String getHeader();
-    
+
     /**
      * Return the width of the column at the creation.
+     *
      * @return the width of the column.
      */
     public int getWidth();
-    
+
     /**
      * Return the alignment of the column.
+     *
      * @see org.eclipse.swt.SWT
      * @return an integer representing the alignment inside the column.
      */
     public int getAlignment();
-    
+
     /**
-     * Provide the text to show in the tooltip when the cursor comes over the column header.
+     * Provide the text to show in the tooltip when the cursor comes over the
+     * column header.
+     *
      * @return text to show in the tooltip
      */
     public String getTooltip();
-    
+
     /**
-     * Return the labelProvider which provides the information to put in column cells.
+     * Return the labelProvider which provides the information to put in column
+     * cells.
+     *
      * @return a ColumnLabelProvider.
      */
     public ColumnLabelProvider getLabelProvider();
-    
+
     /**
      * Return a ViewerComparator used to sort viewer's contents.
+     *
      * @return the comparator.
      */
     public ViewerComparator getComparator();
-    
+
     /**
-     * Return the provider of the percentage.
-     * Used to draw bar charts in columns.
+     * Return the provider of the percentage. Used to draw bar charts in
+     * columns.
+     *
      * @return the percentageProvider.
      */
     public ITmfColumnPercentageProvider getPercentageProvider();
index 8811eaae1cb3c9b0ecacba7e26e2766851671901..18e9ebed7c3d83927a8cb15dac8a6ef5bf00df39 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -21,11 +21,14 @@ import org.eclipse.osgi.util.NLS;
  * @author Mathieu Denis
  */
 public class Messages extends NLS {
+
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.statistics.model.messages"; //$NON-NLS-1$
+
     /**
      * CPU statistic name.
      */
     public static String TmfStatisticsData_CPUs;
+
     /**
      * Event type statistic name.
      */
index 2600102e46650848bd1c9eee2c36b624cc0a3bb2..7d9662a513ecfdb9603b91153ce2630f0a5f8fc3 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial Implementation
  *   Bernd Hufmann - Added Annotations
  *******************************************************************************/
 
@@ -28,26 +28,33 @@ public class TmfBaseColumnData implements ITmfStatisticsColumnData {
      * Name of the column.
      */
     protected final String fHeader;
+
     /**
      * Width of the column.
      */
     protected final int fWidth;
+
     /**
      * Alignment of the column.
      */
     protected final int fAlignment;
+
     /**
      * Tooltip of the column.
      */
     protected final String fTooltip;
+
     /**
-     * Adapts a StatisticsTreeNode into the content of it's corresponding cell for that column.
+     * Adapts a StatisticsTreeNode into the content of it's corresponding cell
+     * for that column.
      */
     protected final ColumnLabelProvider fLabelProvider;
+
     /**
      * Used to sort elements of this column. Can be null.
      */
     protected final ViewerComparator fComparator;
+
     /**
      * Used to draw bar charts in this column. Can be null.
      */
index d0dc21e729da296fc029bd9cc88feea3cac54955..7bc3ac3bf933b48953355724bb51da3e82dbad88 100755 (executable)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011, 2011 Ericsson
+ * Copyright (c) 2011, 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
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis <mathieu.denis@polymtl.ca>  - Implementation and Initial API
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Implementation and Initial API
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -40,31 +40,37 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
      * Contains the list of the columns
      */
     protected List<TmfBaseColumnData> fColumnData = null;
+
     /**
      * Level column names
      */
     protected final static String LEVEL_COLUMN = Messages.TmfStatisticsView_LevelColumn;
+
     /**
      * Number of events column names
      */
     protected final static String EVENTS_COUNT_COLUMN = Messages.TmfStatisticsView_NbEventsColumn;
+
     /**
      * Level column tooltips
      */
     protected final static String LEVEL_COLUMN_TIP = Messages.TmfStatisticsView_LevelColumnTip;
+
     /**
      * Number of events column tooltips
      */
     protected final static String EVENTS_COUNT_COLUMN_TIP = Messages.TmfStatisticsView_NbEventsTip;
+
     /**
      * Level for which statistics should not be displayed.
      */
     protected Set<String> fFolderLevels = new HashSet<String>(Arrays.asList(new String[] { "Event Types" })); //$NON-NLS-1$
+
     /**
      * Create basic columns to represent the statistics data
      */
     public TmfBaseColumnDataProvider() {
-        // List that will be used to create the table.
+        /* List that will be used to create the table. */
         fColumnData = new Vector<TmfBaseColumnData>();
         fColumnData.add(new TmfBaseColumnData(LEVEL_COLUMN, 200, SWT.LEFT, LEVEL_COLUMN_TIP, new ColumnLabelProvider() {
             @Override
index 10803abb0892311878ea1c7f23ffbedd02a32f7d..5e835a49d13dcd879d8a6e8d9fded4c80915a381 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -34,21 +34,19 @@ import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
 public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /**
-     * <h4>Header for the event types categories.</h4>
+     * Header for the event types categories.
      */
     public static final String HEADER_EVENT_TYPES = Messages.TmfStatisticsData_EventTypes;
 
     /**
-     * <h4>Indicate that it's a value.</h4>
-     * <p>
+     * Indicate that it's a value.
+     *
      * Used when checking the possible child node for a node.
-     * </p>
-     * *
-     * <p>
+     *
      * It differentiate a category of a value by being appended to a value.
-     * </p>
      */
     protected static final String NODE = "z"; //$NON-NLS-1$
+
     /**
      * Root node key.
      */
@@ -82,6 +80,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsData#getChildren(org.eclipse.linuxtools.tmf.util.TmfFixedArray)
      */
     @Override
@@ -119,6 +118,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsData#getAllChildren(org.eclipse.linuxtools.tmf.util.TmfFixedArray)
      */
     @Override
@@ -154,7 +154,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get the event types paths.</h4>
+     * Get the event types paths.
      *
      * @param event
      *            Event to get the path for.
@@ -175,7 +175,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
     }
 
     /**
-     * <h4>Get the standard paths for an event.</h4>
+     * Get the standard paths for an event.
      *
      * @param event
      *            Event to get the path for.
@@ -193,6 +193,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsData#increase(org.eclipse.linuxtools.tmf.event.TmfEvent, org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfEventInfo, int)
      */
     @Override
@@ -202,6 +203,7 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsData#registerEvent(org.eclipse.linuxtools.tmf.event.TmfEvent, org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfEventInfo)
      */
     @Override
@@ -219,8 +221,8 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfStatisticsData#registerName
-     * (org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfFixedArray)
+     *
+     * @see org.eclipse.linuxtools.tmf.ui.views.statistics.model.AbsTmfStatisticsTree#registerName(org.eclipse.linuxtools.tmf.core.util.TmfFixedArray)
      */
     @Override
     protected void registerName(TmfFixedArray<String> path) {
index 52aa1a27169ba9c663ecb63ac262fbdc06f76047..b5d0f284a123655c79cc7b89cabb37056c731ea5 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Intial API and Implementation
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Intial API and Implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -15,15 +15,15 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
 /**
  * Primitive container for Statistics data
  *
- * Contains information about statistics that can be retrieved with any type
- * of traces
+ * Contains information about statistics that can be retrieved with any type of
+ * traces
  *
  * @version 1.0
  * @author Mathieu Denis
  */
 public class TmfStatistics {
-       /**
-        * <h4>Number of event</h4>
-        */
-       public long nbEvents = 0;
+    /**
+     * Number of events.
+     */
+    public long nbEvents = 0;
 }
index f56e6a7d9da3526eeab67db56ec9a5eeee0ba3b6..bfc1de29f7187027132c04c5fddffc42486e4b9d 100755 (executable)
@@ -7,9 +7,9 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Yann N. Dauphin     (dhaemon@gmail.com)    - Implementation for stats
- *   Francois Godin (copelnug@gmail.com)        - Re-design for new stats structure
- *   Mathieu Denis  (mathieu.denis@polymtl.ca)  - Re-design for new stats structure (2)
+ *   Yann N. Dauphin <dhaemon@gmail.com> - Implementation for stats
+ *   Francois Godin <copelnug@gmail.com> - Re-design for new stats structure
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Re-design for new stats structure (2)
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -21,108 +21,137 @@ import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray;
 /**
  * A tree where nodes can be accessed efficiently using paths.
  *
- * It works like file systems. Each node is identified by a key. A path is
- * an array ({@link TmfFixedArray}) of String. The elements of the array
- * represent the path from the root to this node.
+ * It works like file systems. Each node is identified by a key. A path is an
+ * array ({@link TmfFixedArray}) of String. The elements of the array represent
+ * the path from the root to this node.
  *
  * @version 1.0
  * @author Mathieu Denis
  */
 public class TmfStatisticsTreeNode {
-       /**
-        * <h4>Value of the node.</h4>
-        */
+
+    /**
+     * Value of the node.
+     */
     protected TmfStatistics fValue;
-       /**
-        * <h4>Path of the node.</h4>
-        */
+
+    /**
+     * Path of the node.
+     */
     protected TmfFixedArray<String> fPath;
-       /**
-        * <h2>Corresponding StatisticsData.</h2>
-        */
+
+    /**
+     * Corresponding StatisticsData.
+     */
     protected AbsTmfStatisticsTree fNodes;
-       /**
-        * <h4>Constructor.</h4>
-        * @param path Path to the node.
-        * @param nodes Corresponding StatisticsData.
-        */
-       public TmfStatisticsTreeNode(final TmfFixedArray<String> path, AbsTmfStatisticsTree nodes) {
-               fPath = path;
-               fNodes = nodes;
-               fValue = new TmfStatistics();
-       }
-       /**
-        * <h4>Test if a node contain the specified child.</h4>
-        * @param key Name of the child.
-        * @return true: if child with given key is present, false: if no child exists with given key name
-        */
-       public boolean containsChild(String key) {
-               if(AbsTmfStatisticsTree.ROOT.equals(fPath)) {
+
+    /**
+     * Constructor.
+     *
+     * @param path
+     *            Path to the node.
+     * @param nodes
+     *            Corresponding StatisticsData.
+     */
+    public TmfStatisticsTreeNode(final TmfFixedArray<String> path, AbsTmfStatisticsTree nodes) {
+        fPath = path;
+        fNodes = nodes;
+        fValue = new TmfStatistics();
+    }
+
+    /**
+     * Test if a node contain the specified child.
+     *
+     * @param key
+     *            Name of the child.
+     * @return true: if child with given key is present, false: if no child
+     *         exists with given key name
+     */
+    public boolean containsChild(String key) {
+        if (AbsTmfStatisticsTree.ROOT.equals(fPath)) {
             return fNodes.get(new TmfFixedArray<String>(key)) != null;
         }
-               return (fNodes.get(fPath.append(key)) != null);
-       }
-       /**
-        * <h4>Get the children of this node.</h4>
-        * @return Direct children of this node.
-        */
-       public Collection<TmfStatisticsTreeNode> getChildren() {
-               return fNodes.getChildren(fPath);
-       }
-       /**
-     * <h4>Get the children of this node.</h4>
+        return (fNodes.get(fPath.append(key)) != null);
+    }
+
+    /**
+     * Get the children of this node.
+     *
+     * @return Direct children of this node.
+     */
+    public Collection<TmfStatisticsTreeNode> getChildren() {
+        return fNodes.getChildren(fPath);
+    }
+
+    /**
+     * Get the children of this node.
+     *
      * @return Direct children of this node.
      */
     public Collection<TmfStatisticsTreeNode> getAllChildren() {
         return fNodes.getAllChildren(fPath);
     }
-       /**
-        * <h4>Get the key for this node.</h4>
-        * @return Key associated with this node.
-        */
-       public String getKey() {
-               return fPath.get(fPath.size() - 1);
-       }
-       /**
-        * <h4>Get the number of children this node have.</h4>
-        * @return Number of direct children of this node.
-        */
-       public int getNbChildren() {
-               return fNodes.getChildren(fPath).size();
-       }
-       /**
-        * <h4>Return the parent node.</h4>
-        * @return Parent node.
-        */
-       public TmfStatisticsTreeNode getParent() {
-               return fNodes.getParent(fPath);
-       }
-       /**
-        * <h4>Get the path of the node.</h4>
-        * @return The path of the node.
-        */
-       public TmfFixedArray<String> getPath() {
-               return fPath;
-       }
-       /**
-        * <h4>Get the value of this node.</h4>
-        * @return Value associated with this node.
-        */
-       public TmfStatistics getValue() {
-               return fValue;
-       }
-       /**
-        * <h4>Indicate if the node have children.</h4>
-        * @return True if the node has children.
-        */
-       public boolean hasChildren() {
-               return !fNodes.getChildren(fPath).isEmpty();
-       }
-       /**
-        * <h4>Start from creation time i.e. keep key and parent but new statistics and no children.</h4>
-        */
-       public void reset() {
-               fValue = new TmfStatistics();
-               fNodes.reset(fPath);
-       }
-}
\ No newline at end of file
+
+    /**
+     * Get the key for this node.
+     *
+     * @return Key associated with this node.
+     */
+    public String getKey() {
+        return fPath.get(fPath.size() - 1);
+    }
+
+    /**
+     * Get the number of children this node have.
+     *
+     * @return Number of direct children of this node.
+     */
+    public int getNbChildren() {
+        return fNodes.getChildren(fPath).size();
+    }
+
+    /**
+     * Return the parent node.
+     *
+     * @return Parent node.
+     */
+    public TmfStatisticsTreeNode getParent() {
+        return fNodes.getParent(fPath);
+    }
+
+    /**
+     * Get the path of the node.
+     *
+     * @return The path of the node.
+     */
+    public TmfFixedArray<String> getPath() {
+        return fPath;
+    }
+
+    /**
+     * Get the value of this node.
+     *
+     * @return Value associated with this node.
+     */
+    public TmfStatistics getValue() {
+        return fValue;
+    }
+
+    /**
+     * Indicate if the node have children.
+     *
+     * @return True if the node has children.
+     */
+    public boolean hasChildren() {
+        return !fNodes.getChildren(fPath).isEmpty();
+    }
+
+    /**
+     * Start from creation time i.e. keep key and parent but new statistics and
+     * no children.
+     */
+    public void reset() {
+        fValue = new TmfStatistics();
+        fNodes.reset(fPath);
+    }
+}
index 1c90f0c5bc5f0f39c8924004abb0f13a4872b46c..ff8d2f49e1e3edd4b0bd7f7d25911ba1f3227550 100755 (executable)
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -18,8 +18,8 @@ import java.util.Map;
 /**
  * Factory class to create and store TMF statistic trees.
  *
- * Based on a given tree node ID a TMF statistic tree is stored internally.
- * root node is created for each tree. Using the tree node ID the statistics
+ * Based on a given tree node ID a TMF statistic tree is stored internally. A
+ * root node is created for each tree. Using the tree node ID the statistics
  * tree can be retrieved.
  *
  * @version 1.0
@@ -28,18 +28,11 @@ import java.util.Map;
  */
 public class TmfStatisticsTreeRootFactory {
 
-    // -----------------------------------------------------------------------
-    // Data
-    // -----------------------------------------------------------------------
     /**
      * Contains the experiment name as the key and the traces data
      */
     private static final Map<String, AbsTmfStatisticsTree> fTreeInstances = new HashMap<String, AbsTmfStatisticsTree>();
 
-    // -----------------------------------------------------------------------
-    // Methods
-    // -----------------------------------------------------------------------
-
     /**
      * Provide a statisticsTree instance per trace
      *
index 7174b3c9141dc96aa65151cf0b67aa461b98fee9..614be4fcee513bbcbe65acc15871677b06e1b57a 100755 (executable)
@@ -1,13 +1,13 @@
 /*******************************************************************************
  * Copyright (c) 2011, 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
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Initial API
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -17,7 +17,7 @@ import org.eclipse.jface.viewers.Viewer;
 
 /**
  * Adapter TreeViewers can use to interact with StatisticsTreeNode objects.
- * 
+ *
  * @version 1.0
  * @author Mathieu Denis
  * @see org.eclipse.jface.viewers.ITreeContentProvider
@@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.Viewer;
 public class TmfTreeContentProvider implements ITreeContentProvider {
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
      */
     @Override
@@ -35,7 +35,7 @@ public class TmfTreeContentProvider implements ITreeContentProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
      */
     @Override
@@ -45,7 +45,7 @@ public class TmfTreeContentProvider implements ITreeContentProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
      */
     @Override
@@ -55,7 +55,7 @@ public class TmfTreeContentProvider implements ITreeContentProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
      */
     @Override
@@ -65,7 +65,7 @@ public class TmfTreeContentProvider implements ITreeContentProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.IContentProvider#dispose()
      */
     @Override
@@ -74,7 +74,7 @@ public class TmfTreeContentProvider implements ITreeContentProvider {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
      */
     @Override
This page took 0.062507 seconds and 5 git commands to generate.