MCPcopy Create free account
hub / github.com/apache/poi / lookup

Method lookup

src/java/org/apache/poi/util/BinaryTree.java:463–481  ·  view source on GitHub ↗

do the actual lookup of a piece of data @param data the key or value to be looked up @param index _KEY or _VALUE @return the desired Node, or null if there is no mapping of the specified data

(Comparable data, int index)

Source from the content-addressed store, hash-verified

461 * specified data
462 */
463 public Node lookup(Comparable data, int index)
464 {
465 Node rval = null;
466 Node node = _root[ index ];
467
468 while (node != null)
469 {
470 int cmp = compare(data, node.getData(index));
471
472 if (cmp == 0)
473 {
474 rval = node;
475 break;
476 }
477 node = (cmp < 0) ? node.getLeft(index)
478 : node.getRight(index);
479 }
480 return rval;
481 }
482
483 /**
484 * Compare two objects

Callers 6

containsMethod · 0.95
removeMethod · 0.95
doRemoveMethod · 0.95
doGetMethod · 0.95
containsKeyMethod · 0.95
containsValueMethod · 0.95

Calls 4

compareMethod · 0.95
getDataMethod · 0.95
getLeftMethod · 0.95
getRightMethod · 0.95

Tested by

no test coverage detected