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

Method addToLast

vm/JavaAPI/src/java/util/TreeMap.java:3730–3745  ·  view source on GitHub ↗
(Node<K, V> last, K key, V value)

Source from the content-addressed store, hash-verified

3728 }
3729
3730 Node<K, V> addToLast(Node<K, V> last, K key, V value) {
3731 if (last == null) {
3732 root = last = createNode(key, value);
3733 size = 1;
3734 } else if (last.size == Node.NODE_SIZE) {
3735 Node<K, V> newNode = createNode(key, value);
3736 attachToRight(last, newNode);
3737 balance(newNode);
3738 size++;
3739 last = newNode;
3740 } else {
3741 appendFromRight(last, key, value);
3742 size++;
3743 }
3744 return last;
3745 }
3746
3747 /**
3748 * 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