MCPcopy Create free account
hub / github.com/boazy/TWEditorEnhanced / getString

Method getString

src/main/java/DBList.java:121–161  ·  view source on GitHub ↗
(String label)

Source from the content-addressed store, hash-verified

119 }
120
121 public String getString(String label)
122 throws DBException
123 {
124 DBElement element = getElement(label);
125 String value;
126 if (element != null) {
127 int fieldType = element.getType();
128 if (fieldType == 10) {
129 value = (String)element.getValue();
130 }
131 else
132 {
133 if (fieldType == 11) {
134 value = (String)element.getValue();
135 }
136 else
137 {
138 if (fieldType == 12) {
139 LocalizedString string = (LocalizedString)element.getValue();
140 if (string.getSubstringCount() > 0) {
141 LocalizedSubstring substring = string.getSubstring(Main.languageID, 0);
142 if (substring != null)
143 value = substring.getString();
144 else
145 value = string.getSubstring(0).getString();
146 } else {
147 int refid = string.getStringReference();
148 if (refid >= 0)
149 value = Main.getString(refid);
150 else
151 value = new String();
152 }
153 } else {
154 throw new DBException("Field " + label + " is not a string");
155 }
156 }
157 } } else { value = new String(); }
158
159
160 return value;
161 }
162
163 public void setString(String label, String value)
164 throws DBException

Callers 13

actionPerformedMethod · 0.95
setFieldsMethod · 0.95
actionPerformedMethod · 0.95
setFieldsMethod · 0.95
runMethod · 0.95
examineQuestMethod · 0.95
locateSubquestMethod · 0.95
QuestMethod · 0.95
runMethod · 0.95
setFieldsMethod · 0.95
setFieldsMethod · 0.95
actionPerformedMethod · 0.95

Calls 8

getElementMethod · 0.95
getTypeMethod · 0.95
getValueMethod · 0.95
getSubstringCountMethod · 0.95
getSubstringMethod · 0.95
getStringMethod · 0.95
getStringReferenceMethod · 0.95
getStringMethod · 0.95

Tested by

no test coverage detected