Public Member Functions

Comparator< T > Class Template Reference

Default Comparator. More...

#include <Comparator.h>

List of all members.

Public Member Functions

virtual ~Comparator ()
 virtual destructor
virtual int compare (const T &lhs, const T &rhs) const
 compares two variables of type T and indicates which one is smaller or if they are equal

Detailed Description

template<class T>
class Comparator< T >

Default Comparator.

Definition at line 34 of file Comparator.h.


Constructor & Destructor Documentation

template<class T>
virtual Comparator< T >::~Comparator (  )  [inline, virtual]

virtual destructor

Definition at line 40 of file Comparator.h.

    {}


Member Function Documentation

template<class T>
virtual int Comparator< T >::compare ( const T &  lhs,
const T &  rhs 
) const [inline, virtual]

compares two variables of type T and indicates which one is smaller or if they are equal

Parameters:
lhs first variable to compare
rhs second variable to compare
Returns:
-1 if rhs is smaller, 0 if lhs and rhs are equal and 1 if rhs is greater

Reimplemented in KeyDistanceComparator< Metric >, KeyDistanceComparator< KeyPrefixMetric >, IterativeLookup, and KeyDistanceComparator< KeyXorMetric >.

Definition at line 52 of file Comparator.h.

Referenced by BaseKeySortedVector< LookupEntry >::add(), and BaseKeySortedVector< LookupEntry >::isAddable().

    {
        return lhs.compareTo(rhs);
    }


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