MCPcopy Create free account
hub / github.com/GateNLP/gate-core / buildFromSorted

Method buildFromSorted

src/main/java/gate/util/RBTreeMap.java:1608–1616  ·  view source on GitHub ↗

Linear time tree building algorithm from sorted data. Can accept keys and/or values from iterator or stream. This leads to too many parameters, but seems better than alternatives. The four formats that this method accepts are: 1) An iterator of Map.Entries. (it != null, defaultVal == null).

(int size, java.util.Iterator<?> it,
                                java.io.ObjectInputStream str,
                                V defaultVal)

Source from the content-addressed store, hash-verified

1606 * This cannot occur if str is null.
1607 */
1608 private void buildFromSorted(int size, java.util.Iterator<?> it,
1609 java.io.ObjectInputStream str,
1610 V defaultVal)
1611 throws java.io.IOException, ClassNotFoundException {
1612
1613 this.size = size;
1614 root = buildFromSorted(0, 0, size-1, computeRedLevel(size),
1615 it, str, defaultVal);
1616 } // buildFromSorted
1617
1618 /**
1619 * Recursive "helper method" that does the real work of the

Callers 5

RBTreeMapMethod · 0.95
putAllMethod · 0.95
readObjectMethod · 0.95
readTreeSetMethod · 0.95
addAllForTreeSetMethod · 0.95

Calls 5

computeRedLevelMethod · 0.95
nextMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65
readObjectMethod · 0.45

Tested by

no test coverage detected