1 33 34 package edu.rice.cs.drjava.model.debug; 35 36 40 public class DebugWatchData { 41 44 public static final String NO_VALUE = "<not found>"; 45 46 49 public static final String NO_TYPE = ""; 50 51 54 public static final String NOT_LOADED = "<not loaded>"; 55 56 private String _name; 57 private String _value; 58 private String _type; 59 private boolean _showValue; 60 private boolean _showType; 61 private boolean _changed; 62 63 67 public DebugWatchData(String name) { 68 _name = name; 69 _value = ""; 70 _type = ""; 71 _showValue = false; 72 _showType = false; 73 _changed = false; 74 } 75 76 79 public String getName() { 80 return _name; 81 } 82 83 86 public String getValue() { 87 return (_showValue) ? _value : ""; 88 } 89 90 93 public String getType() { 94 return (_showType) ? _type : ""; 95 } 96 97 101 void setName(String name) { 102 _name = name; 103 } 104 105 109 void setValue(Object value) { 110 _showValue = true; 111 String valString = String.valueOf(value); 112 if (!valString.equals(_value)) { 113 _changed = true; 114 } 115 else { 116 _changed = false; 117 } 118 _value = valString; 119 } 120 121 124 void hideValueAndType() { 125 _showValue = false; 126 _showType = false; 127 _changed = false; 128 } 129 130 133 void setNoValue() { 134 _showValue = true; 135 _value = NO_VALUE; 136 _changed = false; 137 } 138 139 143 void setType(String type) { 144 _showType = true; 145 _type = type; 146 } 147 148 151 void setNoType() { 152 _showType = true; 153 _type = NO_TYPE; 154 } 155 156 159 void setTypeNotLoaded() { 160 _showType = true; 161 _type = NOT_LOADED; 162 } 163 164 167 public boolean isChanged() { 168 return _changed; 169 } 170 171 174 public String toString() { 175 return _type + " " + _name + ": " + _value; 176 } 177 } 178 | Popular Tags |