KeyPrefixMetric Class Reference

#include <Comparator.h>

List of all members.


Detailed Description

OverlayKey prefix metric.

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

Constructor & Destructor Documentation

KeyPrefixMetric::KeyPrefixMetric (  )  [inline]

00138     {
00139         bitsPerDigit = 1;
00140     }


Member Function Documentation

OverlayKey KeyPrefixMetric::distance ( const OverlayKey x,
const OverlayKey y 
) const [inline]

calculates the distance from x to y with the prefix metric

Parameters:
x origination key
y destination key
Returns:
|differing suffix|
00151     {
00152         return OverlayKey::getLength() / bitsPerDigit
00153                - x.sharedPrefixLength(y, bitsPerDigit);
00154     }

void KeyPrefixMetric::setBitsPerDigit ( uint  bitsPerDigit  )  [inline]

00157     {
00158         this->bitsPerDigit = bitsPerDigit;
00159     }


Member Data Documentation

Referenced by distance(), and KeyPrefixMetric().


The documentation for this class was generated from the following file:

Generated on Fri Sep 19 13:05:07 2008 for ITM OverSim by  doxygen 1.5.5