Class InverseComparer
Comparator that reverses the result of another comparator.
Inherited Members
Namespace: Tangosol.Util.Comparator
Assembly: Coherence.dll
Syntax
public class InverseComparer : SafeComparer, IEntryAwareComparer, IPortableObject, IQueryCacheComparer, IComparer
Constructors
InverseComparer()
Default constructor.
Declaration
public InverseComparer()
InverseComparer(IComparer)
Construct an InverseComparer.
Declaration
public InverseComparer(IComparer comparer)
Parameters
Type | Name | Description |
---|---|---|
IComparer | comparer | The comparer whose results are inverted by this IComparer. |
Methods
Compare(object, object)
Use the wrapped IComparer to compare the two arguments for order and negate the result.
Declaration
public override int Compare(object o1, object o2)
Parameters
Type | Name | Description |
---|---|---|
object | o1 | The first object to be compared. |
object | o2 | The second object to be compared. |
Returns
Type | Description |
---|---|
int | A positive integer, zero, or a negative integer as the first argument is less than, equal to, or greater than the second. |
Overrides
CompareEntries(IQueryCacheEntry, IQueryCacheEntry)
Compare two entries using the underlying comparator and negate the result.
Declaration
public override int CompareEntries(IQueryCacheEntry entry1, IQueryCacheEntry entry2)
Parameters
Type | Name | Description |
---|---|---|
IQueryCacheEntry | entry1 | The first entry to compare values from; read-only. |
IQueryCacheEntry | entry2 | The second entry to compare values from; read-only. |
Returns
Type | Description |
---|---|
int | A positive integer, zero, or a negative integer as the first entry denotes a value that is is less than, equal to, or greater than the value denoted by the second entry . |
Overrides
Equals(object)
Compare the InverseComparer with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o | The other comparer. |
Returns
Type | Description |
---|---|
bool | true iff this InverseComparer and the passed object are equivalent InverseComparer. |
Overrides
GetHashCode()
Return the hash code for this comparator.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code value for this comparator. |