MCPcopy Index your code
hub / github.com/davidgiven/luje / addToLast

Method addToLast

lib/java/util/TreeMap.java:1012–1027  ·  view source on GitHub ↗
(Node<K, V> last, K key, V value)

Source from the content-addressed store, hash-verified

1010 }
1011
1012 Node<K, V> addToLast(Node<K, V> last, K key, V value) {
1013 if (last == null) {
1014 root = last = createNode(key, value);
1015 size = 1;
1016 } else if (last.size == Node.NODE_SIZE) {
1017 Node<K, V> newNode = createNode(key, value);
1018 attachToRight(last, newNode);
1019 balance(newNode);
1020 size++;
1021 last = newNode;
1022 } else {
1023 appendFromRight(last, key, value);
1024 size++;
1025 }
1026 return last;
1027 }
1028
1029 /**
1030 * Removes all mappings from this TreeMap, leaving it empty.

Callers 1

TreeMapMethod · 0.95

Calls 4

createNodeMethod · 0.95
attachToRightMethod · 0.95
balanceMethod · 0.95
appendFromRightMethod · 0.95

Tested by

no test coverage detected