Newer
Older
MagnetRON / src / org / ntlab / trace / ObjectReference.java
Aki Hongo on 3 Mar 2020 1 KB first commit
  1. package org.ntlab.trace;
  2.  
  3. public class ObjectReference {
  4. private String id;
  5. private String actualType = null; // 実際の型
  6. private String calleeType = null; // 呼び出し先メソッド内での型(静的に決定できる型)
  7. private String callerType = null; // 呼び出し元メソッド内での型(静的に決定できる型)
  8.  
  9. public ObjectReference(String id) {
  10. this.id = id;
  11. this.actualType = null;
  12. }
  13.  
  14. public ObjectReference(String id, String actualType) {
  15. this.id = id;
  16. this.actualType = actualType;
  17. }
  18. public ObjectReference(String id, String actualType, String calleeType) {
  19. this.id = id;
  20. this.actualType = actualType;
  21. this.calleeType = calleeType;
  22. }
  23. public ObjectReference(String id, String actualType, String calleeType, String callerType) {
  24. this.id = id;
  25. this.actualType = actualType;
  26. this.calleeType = calleeType;
  27. this.callerType = callerType;
  28. }
  29.  
  30. public String getId() {
  31. return id;
  32. }
  33. public String getActualType() {
  34. return actualType;
  35. }
  36.  
  37. public String getCalleeType() {
  38. return calleeType;
  39. }
  40.  
  41. public String getCallerType() {
  42. return callerType;
  43. }
  44.  
  45. public void setId(String id) {
  46. this.id = id;
  47. }
  48.  
  49. public void setActualType(String actualType) {
  50. this.actualType = actualType;
  51. }
  52.  
  53. public void setCalleeType(String calleeType) {
  54. this.calleeType = calleeType;
  55. }
  56.  
  57. public void setCallerType(String callerType) {
  58. this.callerType = callerType;
  59. }
  60.  
  61. public boolean equals(Object other) {
  62. if (this == other) return true;
  63. if (!(other instanceof ObjectReference)) return false;
  64. if (id != null && id.equals(((ObjectReference)other).id)) return true;
  65. return false;
  66. }
  67. }