MCPcopy Create free account
hub / github.com/PCGen/pcgen / innerMostStringEnd

Method innerMostStringEnd

code/src/java/pcgen/core/utils/CoreUtility.java:213–242  ·  view source on GitHub ↗

Get the inner most String end @param aString The string to be searched for the innermost ( @return inner most String end

(final String aString)

Source from the content-addressed store, hash-verified

211 * @return inner most String end
212 */
213 public static int innerMostStringEnd(final String aString)
214 {
215 int index = 0;
216 int hi = 0;
217 int current = 0;
218
219 for (int i = 0; i < aString.length(); ++i)
220 {
221 if (aString.charAt(i) == '(')
222 {
223 ++current;
224
225 if (current > hi)
226 {
227 hi = current;
228 }
229 }
230 else if (aString.charAt(i) == ')')
231 {
232 if (current == hi)
233 {
234 index = i;
235 }
236
237 --current;
238 }
239 }
240
241 return index;
242 }
243
244 /**
245 * Get the innermost String start

Callers 3

processBrokenParserMethod · 0.95
buildDependMapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected