MCPcopy Create free account
hub / github.com/ReadyTalk/avian / charAt

Method charAt

classpath/java/lang/StringBuilder.java:115–133  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

113 }
114
115 public char charAt(int i) {
116 if (i < 0 || i >= length) {
117 throw new IndexOutOfBoundsException();
118 }
119
120 flush();
121
122 int index = length;
123 for (Cell c = chain; c != null; c = c.next) {
124 int start = index - c.value.length();
125 index = start;
126
127 if (i >= start) {
128 return c.value.charAt(i - start);
129 }
130 }
131
132 throw new RuntimeException();
133 }
134
135 public StringBuilder insert(int i, String s) {
136 if (i < 0 || i > length) {

Callers 2

indexOfMethod · 0.95
lastIndexOfMethod · 0.95

Calls 3

flushMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.65

Tested by

no test coverage detected