tmf: Switch tmf.ui to Java 7 + fix warnings
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / viewers / statistics / model / TmfBaseColumnDataProvider.java
index 4edced393a61ab34cc782469532137e083731052..4b3d045d4894a81dbeb4c3f898ebacb321ae221d 100755 (executable)
@@ -74,25 +74,25 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
     /**
      * Level for which statistics should not be displayed.
      */
-    protected Set<String> fFolderLevels = new HashSet<String>(Arrays.asList(new String[] { "Event Types" })); //$NON-NLS-1$
+    protected Set<String> fFolderLevels = new HashSet<>(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. */
-        fColumnData = new Vector<TmfBaseColumnData>();
+        fColumnData = new Vector<>();
         /* Column showing the name of the events and its level in the tree */
         fColumnData.add(new TmfBaseColumnData(LEVEL_COLUMN, 200, SWT.LEFT, LEVEL_COLUMN_TIP, new ColumnLabelProvider() {
             @Override
             public String getText(Object element) {
-                return ((TmfStatisticsTreeNode) element).getKey();
+                return ((TmfStatisticsTreeNode) element).getName();
             }
 
             @Override
             public Image getImage(Object element) {
                 TmfStatisticsTreeNode node = (TmfStatisticsTreeNode) element;
-                if (fFolderLevels.contains(node.getKey())) {
+                if (fFolderLevels.contains(node.getName())) {
                     return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
                 }
                 return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
@@ -103,7 +103,7 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
                 TmfStatisticsTreeNode n1 = (TmfStatisticsTreeNode) e1;
                 TmfStatisticsTreeNode n2 = (TmfStatisticsTreeNode) e2;
 
-                return n1.getKey().compareTo(n2.getKey());
+                return n1.getName().compareTo(n2.getName());
             }
         }, null));
 
@@ -112,8 +112,8 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
             @Override
             public String getText(Object element) {
                 TmfStatisticsTreeNode node = (TmfStatisticsTreeNode) element;
-                if (!fFolderLevels.contains(node.getKey())) {
-                    return Long.toString(node.getValue().getTotal());
+                if (!fFolderLevels.contains(node.getName())) {
+                    return Long.toString(node.getValues().getTotal());
                 }
                 return ""; //$NON-NLS-1$
             }
@@ -123,7 +123,7 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
                 TmfStatisticsTreeNode n1 = (TmfStatisticsTreeNode) e1;
                 TmfStatisticsTreeNode n2 = (TmfStatisticsTreeNode) e2;
 
-                return (int) (n1.getValue().getTotal() - n2.getValue().getTotal());
+                return (int) (n1.getValues().getTotal() - n2.getValues().getTotal());
             }
         }, new ITmfColumnPercentageProvider() {
 
@@ -132,12 +132,12 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
                 TmfStatisticsTreeNode parent = node;
                 do {
                     parent = parent.getParent();
-                } while (parent != null && parent.getValue().getTotal() == 0);
+                } while (parent != null && parent.getValues().getTotal() == 0);
 
                 if (parent == null) {
                     return 0;
                 }
-                return (double) node.getValue().getTotal() / parent.getValue().getTotal();
+                return (double) node.getValues().getTotal() / parent.getValues().getTotal();
             }
         }));
 
@@ -147,8 +147,8 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
             @Override
             public String getText(Object element) {
                 TmfStatisticsTreeNode node = (TmfStatisticsTreeNode) element;
-                if (!fFolderLevels.contains(node.getKey())) {
-                    return Long.toString(node.getValue().getPartial());
+                if (!fFolderLevels.contains(node.getName())) {
+                    return Long.toString(node.getValues().getPartial());
                 }
                 return ""; //$NON-NLS-1$
             }
@@ -158,7 +158,7 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
                 TmfStatisticsTreeNode n1 = (TmfStatisticsTreeNode) e1;
                 TmfStatisticsTreeNode n2 = (TmfStatisticsTreeNode) e2;
 
-                return (int) (n1.getValue().getPartial() - n2.getValue().getPartial());
+                return (int) (n1.getValues().getPartial() - n2.getValues().getPartial());
             }
         }, new ITmfColumnPercentageProvider() {
 
@@ -167,12 +167,12 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider {
                 TmfStatisticsTreeNode parent = node;
                 do {
                     parent = parent.getParent();
-                } while (parent != null && parent.getValue().getPartial() == 0);
+                } while (parent != null && parent.getValues().getPartial() == 0);
 
                 if (parent == null) {
                     return 0;
                 }
-                return (double) node.getValue().getPartial() / parent.getValue().getPartial();
+                return (double) node.getValues().getPartial() / parent.getValues().getPartial();
             }
         }));
     }
This page took 0.04542 seconds and 5 git commands to generate.