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

Method pollNode

ZezeJava/ZezeJava/src/main/java/Zeze/Collections/Queue.java:209–226  ·  view source on GitHub ↗

删除并返回整个头节点 @return 头节点,null if empty

()

Source from the content-addressed store, hash-verified

207 * @return 头节点,null if empty
208 */
209 public BQueueNode pollNode() {
210 var root = getRoot();
211 if (root == null)
212 return null;
213
214 var headKey = root.getHeadNodeKey();
215 if (headKey.getNodeId() == 0)
216 return null;
217
218 var head = getNode(headKey);
219 if (head == null)
220 return null;
221
222 root.setHeadNodeKey(head.getNextNodeKey());
223 root.setCount(root.getCount() - head.getValues().size());
224 module._tQueueNodes.remove(headKey);
225 return head;
226 }
227
228 public void clear() {
229 while (pollNode() != null) {

Callers 2

clearMethod · 0.95
onTimerMethod · 0.45

Calls 11

getRootMethod · 0.95
getNodeMethod · 0.95
setHeadNodeKeyMethod · 0.80
getHeadNodeKeyMethod · 0.65
getNodeIdMethod · 0.65
getNextNodeKeyMethod · 0.65
getCountMethod · 0.65
sizeMethod · 0.65
removeMethod · 0.65
setCountMethod · 0.45
getValuesMethod · 0.45

Tested by

no test coverage detected