MCPcopy Create free account
hub / github.com/e2wugui/zeze / insert

Method insert

ZezeJava/ZezeJava/src/main/java/Zeze/Util/KVList.java:315–330  ·  view source on GitHub ↗
(int fromIdx, K key, V value)

Source from the content-addressed store, hash-verified

313 }
314
315 public @NotNull KVList<K, V> insert(int fromIdx, K key, V value) {
316 int n = count;
317 if (fromIdx < 0)
318 fromIdx = 0;
319 if (fromIdx >= n)
320 return add(key, value);
321 reserve(n + 1);
322 Object[] buf = keys;
323 System.arraycopy(buf, fromIdx, buf, fromIdx + 1, n - fromIdx);
324 buf[fromIdx] = key;
325 buf = values;
326 System.arraycopy(buf, fromIdx, buf, fromIdx + 1, n - fromIdx);
327 buf[fromIdx] = value;
328 count = n + 1;
329 return this;
330 }
331
332 public @NotNull KVList<K, V> insert(int fromIdx, K @NotNull [] keys, V @NotNull [] values, int idx, int count) {
333 int n = this.count;

Callers 15

TestEncodeFunction · 0.45
ServiceMethod · 0.45
SelectMethod · 0.45
SetRpcTimeoutMethod · 0.45
AddProtocolFactoryMethod · 0.45
AddRpcContextMethod · 0.45
updateMethod · 0.45
SetHandshakeDoneMethod · 0.45
SetSocketCloseMethod · 0.45
uiThreadScheduleTimeFunction · 0.45
uiThreadScheduleCountFunction · 0.45
ResourceMethod · 0.45

Calls 3

addMethod · 0.95
reserveMethod · 0.95
addAllMethod · 0.95

Tested by 4

TestEncodeFunction · 0.36
writeMethod · 0.36
autoKeyWithInsertMethod · 0.36
testMemorySizeMethod · 0.36