#include <Comparator.h>
Public Member Functions | |
KeyPrefixMetric () | |
OverlayKey | distance (const OverlayKey &x, const OverlayKey &y) const |
calculates the distance from x to y with the prefix metric | |
void | setBitsPerDigit (uint bitsPerDigit) |
Private Attributes | |
uint | bitsPerDigit |
KeyPrefixMetric::KeyPrefixMetric | ( | ) | [inline] |
OverlayKey KeyPrefixMetric::distance | ( | const OverlayKey & | x, | |
const OverlayKey & | y | |||
) | const [inline] |
calculates the distance from x to y with the prefix metric
x | origination key | |
y | destination key |
00151 { 00152 return OverlayKey::getLength() / bitsPerDigit 00153 - x.sharedPrefixLength(y, bitsPerDigit); 00154 }
void KeyPrefixMetric::setBitsPerDigit | ( | uint | bitsPerDigit | ) | [inline] |
uint KeyPrefixMetric::bitsPerDigit [private] |
Referenced by distance(), and KeyPrefixMetric().