fork download
  1. //MapExample.cityHot();
  2.  
  3. Map<String,Decimal> currISOCodeAndExchangeRateMap = new Map<String,Decimal>();
  4. currISOCodeAndExchangeRateMap.put('AUD', 0.73);
  5. currISOCodeAndExchangeRateMap.put('CAD', 0.78);
  6. currISOCodeAndExchangeRateMap.put('EUR', 1.13);
  7. currISOCodeAndExchangeRateMap.put('NZD', 0.68);
  8. currISOCodeAndExchangeRateMap.put('INR', 0.013);
  9. currISOCodeAndExchangeRateMap.put('SAD', 0.45);
  10.  
  11. System.debug(currISOCodeAndExchangeRateMap);
  12. System.debug(currISOCodeAndExchangeRateMap.keySet());
  13. System.debug(currISOCodeAndExchangeRateMap.values());
  14.  
  15.  
  16. Set<String> s1 = currISOCodeAndExchangeRateMap.keySet();
  17. for(String s : s1) {
  18. System.debug(s + ' ' + currISOCodeAndExchangeRateMap.get(s));
  19. }
  20.  
  21. // for(Decimal c : currISOCodeAndExchangeRateMap.values()){
  22. // System.debug(c);
  23. // }
  24.  
  25. for(String con : currISOCodeAndExchangeRateMap.keySet()){
  26. if(con.contains('SAD')){
  27. System.debug('Mapta sad para birimi var.');
  28. }
  29. }
  30. System.debug('Mapta sad para birimi yok.');
  31.  
  32.  
  33. Set<String> birVeUstu = {};
  34. Set<String> birVeAlti = {};
  35.  
  36. for(Decimal chg : currISOCodeAndExchangeRateMap.values()){
  37. if(chg >= 1){
  38. birVeUstu = currISOCodeAndExchangeRateMap.keySet();
  39. }else{
  40. birVeAlti += currISOCodeAndExchangeRateMap.keySet();
  41. }
  42.  
  43. }
  44.  
  45. System.debug(birVeUstu);
  46. System.debug(birVeAlti);
Success #stdin #stdout #stderr 0.01s 7796KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog:1: expected expression