sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerDataPlugins.java
changeset 12 ae255c9aa552
parent 5 844b047e260d
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerDataPlugins.java	Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerDataPlugins.java	Wed Jun 23 15:05:09 2010 +0300
@@ -28,8 +28,10 @@
 
 
 public class ProfilerDataPlugins {
-	private Map<ITrace, Boolean> pluginsSelectionMap;
+	private Map<ITrace, Boolean> pluginsSelectionMap = new HashMap<ITrace, Boolean>();
 	private final IPath profilerDataPath;
+	private long time;
+	private long size;
 	
 	/**
 	 * Constructor
@@ -39,7 +41,9 @@
 	 */
 	public ProfilerDataPlugins(IPath profilerDataPath, List<ITrace> plugins){
 		this.profilerDataPath = profilerDataPath;
-		initPlugins(plugins);
+		if(plugins != null){
+			initPlugins(plugins);
+		}		
 	}
 	
 	/**
@@ -48,7 +52,6 @@
 	 * @param plugins list of the plugins
 	 */
 	public void initPlugins(List<ITrace> plugins){
-		pluginsSelectionMap = new HashMap<ITrace, Boolean>();
 		removeDuplicatePriorityPlugin(plugins);
 		for(ITrace trace : plugins){
 			pluginsSelectionMap.put(trace, true);
@@ -56,6 +59,17 @@
 	}
 	
 	/**
+	 * Update both time and size
+	 * 
+	 * @param time
+	 * @param size
+	 */
+	public void updateTimeAndSize(long time, long size){
+		this.time += time;
+		this.size = size;
+	}
+	
+	/**
 	 * Get list of the plugins
 	 * 
 	 * @return list of the plugins
@@ -107,7 +121,7 @@
 	 */
 	public void setChecked(ITrace trace, boolean checked){
 		if(pluginsSelectionMap.containsKey(trace)){
-			pluginsSelectionMap.put(trace, new Boolean(checked));
+			pluginsSelectionMap.put(trace, Boolean.valueOf(checked));
 		}
 	}
 	
@@ -127,25 +141,12 @@
 	 */
 	public void unCheckAll(){
 		for(ITrace trace : getPlugins()){
-			if(!isMandatory(trace)){
+			if(!trace.isMandatory()){
 				setChecked(trace, false);
-			}
+			}		
 		}
 	}
 	
-	/**
-	 * Check whether given trace mandatory or not
-	 * @param trace
-	 * @return
-	 */
-	public boolean isMandatory(ITrace trace){
-		if(pluginsSelectionMap.containsKey(trace)){
-			if(trace.getTraceId() == 1){
-				return true;
-			}		
-		}
-		return false;
-	}
 		
 	/**
 	 * Get profiler data file's path
@@ -173,4 +174,19 @@
 			}
 		}
 	}
+	
+	/**
+	 * @return the time
+	 */
+	public long getTime() {
+		return time;
+	}
+
+	/**
+	 * @return the size
+	 */
+	public long getSize() {
+		return size;
+	}
 }
+