MipsSettings.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package tools.mips;
  7. import java.util.HashMap;
  8. /**
  9. *
  10. * @author EUGENIO CARVALHO
  11. */
  12. public class MipsSettings {
  13. public boolean stepByStep = false;
  14. public boolean debugmode = true;
  15. protected HashMap<String, String> data = new HashMap<String, String>();
  16. public MipsSettings() {
  17. }
  18. public MipsSettings SetInstructionMemoryFile(String filename) {
  19. data.put("mi", filename);
  20. return this;
  21. }
  22. public MipsSettings SetDataMemoryFile(String filename) {
  23. data.put("md", filename);
  24. return this;
  25. }
  26. public MipsSettings Set(String prop, String value) {
  27. data.put(prop, value);
  28. return this;
  29. }
  30. public String Get(String prop) {
  31. return Get(prop, "");
  32. }
  33. public String Get(String prop, String value) {
  34. if (data.containsKey(prop)) {
  35. return data.get(prop);
  36. }
  37. return value;
  38. }
  39. }