00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _DECAF_UTIL_COMPARATORS_LESS_H_
00019 #define _DECAF_UTIL_COMPARATORS_LESS_H_
00020
00021 #include <decaf/util/Comparator.h>
00022
00023 namespace decaf {
00024 namespace util {
00025 namespace comparators {
00026
00036 template< typename E >
00037 class Less : public decaf::util::Comparator<E> {
00038 public:
00039
00040 Less() {}
00041 virtual ~Less() {}
00042
00043 virtual bool operator() ( const E& left, const E& right ) const {
00044 return left < right;
00045 }
00046
00047 virtual int compare( const E& o1, const E& o2 ) const {
00048
00049 if( o1 > o2 ) {
00050 return 1;
00051 } else if( o1 < o2 ) {
00052 return -1;
00053 }
00054
00055 return 0;
00056 }
00057
00058 };
00059
00060 }}}
00061
00062 #endif