Static Public Member Functions

KeyRingMetric Class Reference

OverlayKey Ring Metric. More...

#include <Comparator.h>

List of all members.

Static Public Member Functions

static OverlayKey distance (const OverlayKey &x, const OverlayKey &y)
 calculates the distance from x to y on a bidirectional ring

Detailed Description

OverlayKey Ring Metric.

Definition at line 111 of file Comparator.h.


Member Function Documentation

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

calculates the distance from x to y on a bidirectional ring

Parameters:
x origination key
y destination key
Returns:
|y-x| on a bidirectional ring

Definition at line 121 of file Comparator.h.

    {
        OverlayKey dist1(x - y);
        OverlayKey dist2(y - x);

        if (dist1 > dist2)
            return dist2;
        else
            return dist1;
    }


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