MCPcopy Create free account
hub / github.com/davidgiven/luje / clone

Method clone

lib/java/util/TreeMap.java:139–158  ·  view source on GitHub ↗
(Node<K, V> parent)

Source from the content-addressed store, hash-verified

137 }
138
139 @SuppressWarnings("unchecked")
140 Node<K, V> clone(Node<K, V> parent) throws CloneNotSupportedException {
141 Node<K, V> clone = (Node<K, V>) super.clone();
142 clone.keys = (K[]) new Object[NODE_SIZE];
143 clone.values = (V[]) new Object[NODE_SIZE];
144 System.arraycopy(keys, 0, clone.keys, 0, keys.length);
145 System.arraycopy(values, 0, clone.values, 0, values.length);
146 clone.left_idx = left_idx;
147 clone.right_idx = right_idx;
148 clone.parent = parent;
149 if (left != null) {
150 clone.left = left.clone(clone);
151 }
152 if (right != null) {
153 clone.right = right.clone(clone);
154 }
155 clone.prev = null;
156 clone.next = null;
157 return clone;
158 }
159 }
160
161 @SuppressWarnings("unchecked")

Callers

nothing calls this directly

Calls 2

arraycopyMethod · 0.95
cloneMethod · 0.45

Tested by

no test coverage detected