sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/DataMiningPalette.java
changeset 12 ae255c9aa552
parent 2 b9ab3b238396
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/DataMiningPalette.java	Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/DataMiningPalette.java	Wed Jun 23 15:05:09 2010 +0300
@@ -30,29 +30,30 @@
 
 public class DataMiningPalette {
 
-	private Map<Object, RGB> palette = new HashMap<Object, RGB>();
+	private transient final Map<Object, RGB> palette = new HashMap<Object, RGB>();
 
 	private boolean haveEntry(Object entry) {
 		return palette.containsKey(entry);
 	}
 
-	private boolean haveColor(RGB color) {
+	private boolean haveColor(final RGB color) {
 		return palette.containsValue(color);
 	}
 
-	private void add(Object entry, RGB color) {
+	private void add(final Object entry, final RGB color) {
 		palette.put(entry, color);
 	}
 
-	private void update(Object entry, RGB color) {
+	private void update(final Object entry, final RGB color) {
 		palette.remove(entry);
 		palette.put(entry, color);
 	}
 
 	private RGB hsv2rgb(int hue, double saturation, double value) {
 
-		if (hue >= 360)
+		if (hue >= 360){
 			hue %= 360;
+		}
 		int Hi = (hue / 60) % 6;
 		double f = (double) hue / (double) 60 - Hi;
 
@@ -141,9 +142,9 @@
 			
 			RGB myRGB = new RGB(channelValue[indexR], channelValue[indexG], channelValue[indexB]);
 
-			if (haveColor(myRGB))
+			if (haveColor(myRGB)){
 				continue;
-
+			}
 			add(entry, myRGB);
 			
 			if (!entryListItr.hasNext())
@@ -182,9 +183,9 @@
 
 				RGB myRGB = hsv2rgb(hueEntry[i], saturation, saturation);
 
-				if (haveColor(myRGB))
+				if (haveColor(myRGB)){
 					continue;
-
+				}
 				add(entry, myRGB);
 				--remain;