KeyExtractor Class | 
Namespace: Tangosol.Util.Extractor
public class KeyExtractor : AbstractExtractor, IPortableObject
The KeyExtractor type exposes the following members.
| Name | Description | |
|---|---|---|
| KeyExtractor | 
            Default constructor.
              | |
| KeyExtractor(String) | 
            Construct a KeyExtractor for a specified member name.
              | |
| KeyExtractor(IValueExtractor) | 
            Construct a KeyExtractor based on a specified
            IValueExtractor.
              | 
| Name | Description | |
|---|---|---|
| Extractor | 
            The underlying IValueExtractor.
              | |
| Target | 
            The target of the extractor.
              (Inherited from AbstractExtractor.) | 
| Name | Description | |
|---|---|---|
| Compare | 
            Compares its two arguments for order.
              (Inherited from AbstractExtractor.) | |
| CompareEntries | 
            Compare two entries.
              (Inherited from AbstractExtractor.) | |
| Equals | 
            Compare the KeyExtractor with another object to determine
            equality.
              (Overrides ObjectEquals(Object).) | |
| Extract | 
            Extract the value from the passed object.
              (Overrides AbstractExtractorExtract(Object).) | |
| ExtractFromEntry | 
            Extract the value from the passed Entry object. The returned 
            value should follow the conventions outlined in the 
            Extract(Object) method.
              (Inherited from AbstractExtractor.) | |
| ExtractOriginalFromEntry | 
            Extract the value from the "original value" of the passed 
            CacheEntry object or the key (if targeted). This method's conventions are exactly the same
            as the ExtractFromEntry(ICacheEntry) method.
              (Inherited from AbstractExtractor.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.  (Inherited from Object.) | |
| GetHashCode | 
            Determine a hash value for the KeyExtractor object according
            to the general Object.GetHashCode contract.
              (Overrides ObjectGetHashCode.) | |
| GetType | Gets the Type of the current instance.  (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object.  (Inherited from Object.) | |
| ReadExternal | 
            Restore the contents of a user type instance by reading its state
            using the specified IPofReader object.
              | |
| ToString | 
            Provide a human-readable description of this KeyExtractor
            object.
              (Overrides ObjectToString.) | |
| WriteExternal | 
            Save the contents of a POF user type instance by writing its
            state using the specified IPofWriter object.
              | 
| Name | Description | |
|---|---|---|
| m_extractor | 
            The underlying IValueExtractor.
              | |
| m_target | 
            Specifies which part of the entry should be used by the
            ExtractFromEntry(ICacheEntry) operation. Legal values are
            VALUE (default) or KEY.
              (Inherited from AbstractExtractor.) | 
The major difference between the KeyExtractor and a standard ReflectionExtractor is that when used in various IFilter implementations it forces the evaluation of entry keys rather than entry values.
For example, consider a key object that consists of two properties: "FirstName" and "LastName". To retrieve all keys that have a value of the "LastName" property equal to "Smith", the following query could be used:
            IValueExtractor extractor = new KeyExtractor("LastName");
            ICollection keys = cache.GetKeys(new EqualsFilter(extractor, "Smith"));
            
            As of Coherence 3.5, the same effect can be achieved for subclasses 
            of the AbstractExtractor, for example:
            
            IValueExtractor extractor = new ReflectionExtractor("LastName", 
            null,AbstractExtractor.KEY);
            ICollection keys = cache.GetKeys(new EqualsFilter(extractor, "Smith"));