Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
12c (12.2.1.4.0)
E90869-02
A synthetic IValueExtractor that returns a result of comparison between two values extracted from the same target.

Namespace: Tangosol.Util.Extractor
Assembly: Coherence (in Coherence.dll) Version: 12.2.1.4014 (12.2.1.4014)

Syntax

C#
public class ComparisonValueExtractor : AbstractCompositeExtractor

Remarks

In a most general case, the extracted value represents an integer value calculated accordingly to the contract of CompareTo(Object) or Compare(Object, Object) methods. However, in more specific cases, when the compared values are of common numeric type, the ComparisonValueExtractor will return a numeric difference between those values. The .NET type of the comparing values will dictate the .NET type of the result.

For example, lets assume that a cache contains business objects that have two properties: SellPrice and BuyPrice (both double). Then, to query for all objects that have SellPrice less than BuyPrice we would use the following:

CopyC#
ValueExtractor extractDiff = new ComparisonValueExtractor(
  new ReflectionExtractor("SellPrice"),
  new ReflectionExtractor("BuyPrice"));
Filter filter = new LessFilter(extractDiff, 0.0);
ICollection entries = cache.GetEntries(filter);

Inheritance Hierarchy

System..::..Object
  Tangosol.Util.Extractor..::..AbstractExtractor
    Tangosol.Util.Extractor..::..AbstractCompositeExtractor
      Tangosol.Util.Extractor..::..ComparisonValueExtractor

See Also