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

Method oppositeIndex

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

Get the opposite index of the specified index @param index _KEY or _VALUE @return _VALUE (if _KEY was specified), else _KEY

(int index)

Source from the content-addressed store, hash-verified

443 * @return _VALUE (if _KEY was specified), else _KEY
444 */
445 private int oppositeIndex(int index)
446 {
447
448 // old trick ... to find the opposite of a value, m or n,
449 // subtract the value from the sum of the two possible
450 // values. (m + n) - m = n; (m + n) - n = m
451 return _INDEX_SUM - index;
452 }
453
454 /**
455 * do the actual lookup of a piece of data

Callers 2

doRemoveMethod · 0.95
doGetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected