MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / addToLast

Method addToLast

Ports/CLDC11/src/java/util/TreeMap.java:3728–3743  ·  view source on GitHub ↗
(Node<K, V> last, K key, V value)

Source from the content-addressed store, hash-verified

3726 }
3727
3728 Node<K, V> addToLast(Node<K, V> last, K key, V value) {
3729 if (last == null) {
3730 root = last = createNode(key, value);
3731 size = 1;
3732 } else if (last.size == Node.NODE_SIZE) {
3733 Node<K, V> newNode = createNode(key, value);
3734 attachToRight(last, newNode);
3735 balance(newNode);
3736 size++;
3737 last = newNode;
3738 } else {
3739 appendFromRight(last, key, value);
3740 size++;
3741 }
3742 return last;
3743 }
3744
3745 /// Removes all mappings from this TreeMap, leaving it empty.
3746 ///

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