MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / get

Method get

src/class172/Code06_TextEditor1.java:158–173  ·  view source on GitHub ↗
(int pos, int len)

Source from the content-addressed store, hash-verified

156
157 // 从整个文章的pos位置,往后len的长度,这些内容找到,写入进str
158 public static void get(int pos, int len) {
159 find(pos);
160 int curb = bi;
161 pos = pi;
162 int done = (len < siz[curb] - pos) ? len : (siz[curb] - pos);
163 System.arraycopy(space[curb], pos, str, 0, done);
164 curb = nxt[curb];
165 while (curb != -1 && done + siz[curb] <= len) {
166 System.arraycopy(space[curb], 0, str, done, siz[curb]);
167 done += siz[curb];
168 curb = nxt[curb];
169 }
170 if (curb != -1 && done < len) {
171 System.arraycopy(space[curb], 0, str, done, len - done);
172 }
173 }
174
175 public static void main(String[] args) throws Exception {
176 FastReader in = new FastReader();

Callers 15

mainMethod · 0.95
criticalConnectionsMethod · 0.45
addNumMethod · 0.45
delNumMethod · 0.45
getMinMethod · 0.45
getCutMethod · 0.45
calcEquationMethod · 0.45
findMethod · 0.45
unionMethod · 0.45
queryMethod · 0.45
kmpMethod · 0.45
nextArrayMethod · 0.45

Calls 1

findMethod · 0.95

Tested by

no test coverage detected