public VHashMap humanise() { VHashMap vHashMap = new VHashMap(); for (Object value : this.keySet()) { if (this.get(value) == null) { // System.out.println("Found a null object and converting to blank"); vHashMap.put(value, ""); } // else // if(this.get(value).getClass().getName().contains("java.lang.Long"))//||this.get(value).getClass().getName().contains("java.lang.Long")) // { // // System.out.println("Changing the value "+this.get(value)); // vHashMap.put(value,convertToDecimal(this.get(value))); // } // else // if(this.get(value).getClass().getName().contains("java.lang.BigDecimal"))//||this.get(value).getClass().getName().contains("java.lang.Long")) // { // //System.out.println("Changing the value "+this.get(value)); // vHashMap.put(value,convertToDecimal(this.get(value))); // } else { // System.out.println("Class type :"+this.get(value).getClass()); // System.out.println("Found " + this.get(value).getClass() + " and converting to string"); String replaceValue = convertToString(this.get(value)); // this.remove(value) ; vHashMap.put(value, replaceValue); } } return vHashMap; }
public void equals(VHashMap hashMap) { if (hashMap.keySet().equals(this.keySet())) { System.out.println("Both keys are Equal"); } else System.out.println("Both keys are not Equal"); if (hashMap.entrySet().equals(this.entrySet())) { System.out.println("Both datasets are Equal"); } else System.out.println("Both datasets are NOT Equal"); }
public VHashMap addExceptions() { VHashMap vHashMap = new VHashMap(); for (Object key : this.keySet()) { if (String.valueOf(this.get(key)).contains(".00000")) { vHashMap.put(key, String.valueOf(this.get(key)).replace(".00000", "")); } else if (String.valueOf(this.get(key)).contains("(BLANK)")) { vHashMap.put(key, String.valueOf(this.get(key)).replace("(BLANK)", "")); } else if (String.valueOf(this.get(key)).contains(".")) { vHashMap.put(key, String.valueOf(this.get(key)).replaceFirst("\\.0*$|(\\.\\d*?)0+$", "$1")); } else vHashMap.put(key, String.valueOf(this.get(key))); } return vHashMap; }