class comparator#( type T = int )
singleton Provides strategies to compare objects.
| T | optional The type of an object to be compared. The default is int. |
| comparator | singleton Provides strategies to compare objects. |
| Types | |
| this_type | The shorthand of comparator #(T). |
| Functions | |
| new | protected Creates a new comparator. |
| get_instance | static Returns the singleton instance of this comparator. |
| eq | virtual Returns 1 if two inputs are equal. |
| ne | virtual Returns 1 if two inputs are not equal. |
| lt | virtual Returns 1 if x is less than y. |
| gt | virtual Returns 1 if x is greater than y. |
| le | virtual Returns 1 if x is less than or equal to y. |
| ge | virtual Returns 1 if x is greater than or equal to y. |
typedef comparator#( T ) this_type
The shorthand of comparator #(T).
virtual function bit ne( T x, T y )
virtual Returns 1 if two inputs are not equal.
| x | An input of type T. |
| y | Another input of type T. |
This function returns the negated value of eq (x,y).
virtual function bit gt( T x, T y )
virtual Returns 1 if x is greater than y.
| x | An input of type T. |
| y | Another input of type T. |
This function returns the value of lt (y,x).
virtual function bit le( T x, T y )
virtual Returns 1 if x is less than or equal to y.
| x | An input of type T. |
| y | Another input of type T. |
This function returns the negated value of gt (x,y).
virtual function bit ge( T x, T y )
virtual Returns 1 if x is greater than or equal to y.
| x | An input of type T. |
| y | Another input of type T. |
This function returns the negated value of lt (x,y).
singleton Provides strategies to compare objects.
class comparator#( type T = int )
The shorthand of comparator #(T).
typedef comparator#( T ) this_type
protected Creates a new comparator.
protected function new()
static Returns the singleton instance of this comparator.
static function this_type get_instance()
virtual Returns 1 if two inputs are equal.
virtual function bit eq( T x, T y )
virtual Returns 1 if two inputs are not equal.
virtual function bit ne( T x, T y )
virtual Returns 1 if x is less than y.
virtual function bit lt( T x, T y )
virtual Returns 1 if x is greater than y.
virtual function bit gt( T x, T y )
virtual Returns 1 if x is less than or equal to y.
virtual function bit le( T x, T y )
virtual Returns 1 if x is greater than or equal to y.
virtual function bit ge( T x, T y )