Show / Hide Table of Contents

Class InverseComparer

Comparator that reverses the result of another comparator.

Inheritance
object
SafeComparer
InverseComparer
Implements
IEntryAwareComparer
IPortableObject
IQueryCacheComparer
IComparer
Inherited Members
SafeComparer.Comparer
SafeComparer.IsKeyComparer()
SafeComparer.IsKeyComparer(IComparer)
SafeComparer.ReadExternal(IPofReader)
SafeComparer.WriteExternal(IPofWriter)
SafeComparer.ToString()
SafeComparer.CompareSafe(IComparer, object, object)
SafeComparer.Instance
SafeComparer.m_comparer
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
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
SafeComparer.Compare(object, object)

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
SafeComparer.CompareEntries(IQueryCacheEntry, IQueryCacheEntry)

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
SafeComparer.Equals(object)

GetHashCode()

Return the hash code for this comparator.

Declaration
public override int GetHashCode()
Returns
Type Description
int

The hash code value for this comparator.

Overrides
SafeComparer.GetHashCode()

Implements

IEntryAwareComparer
IPortableObject
IQueryCacheComparer
IComparer
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.