Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.1.0 E18814-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.util.extractor
Class ChainedExtractor

`java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.util.extractor.AbstractExtractor
com.tangosol.util.extractor.AbstractCompositeExtractor
com.tangosol.util.extractor.ChainedExtractor`

All Implemented Interfaces:
  ExternalizableLite, PortableObject, QueryMapComparator, ValueExtractor, java.io.Serializable, java.util.Comparator

      public class ChainedExtractor

extends AbstractCompositeExtractor

Composite ValueExtractor implementation based on an array of extractors. The extractors in the array are applied sequentially left-to-right, so a result of a previous extractor serves as a target object for a next one.

Author:
  gg 2003.09.22

Field Summary

Fields inherited from class com.tangosol.util.extractor.AbstractCompositeExtractor
`m_aExtractor`

Fields inherited from class com.tangosol.util.extractor.AbstractExtractor
`KEY, m_nTarget, VALUE`

Constructor Summary
`ChainedExtractor()` Default constructor (necessary for the ExternalizableLite interface).
`ChainedExtractor(java.lang.String sName)` Construct a ChainedExtractor for a specified method name sequence.
`ChainedExtractor(ValueExtractor[] aExtractor)` Construct a ChainedExtractor based on a specified ValueExractor array.
`ChainedExtractor(ValueExtractor extractor1, ValueExtractor extractor2)` Construct a ChainedExtractor based on two extractors.

Method Summary
`static ValueExtractor[]` | `createExtractors(java.lang.String sName)` Parse a dot-delimited sequence of method names and instantiate a corresponding array of `ReflectionExtractor` objects.
`java.lang.Object` | `extract(java.lang.Object oTarget)` Extract the value from the passed object.
`java.lang.Object` | `extractFromEntry(java.util.Map.Entry entry)` Extract the value from the passed entry.
`java.lang.Object` | `extractOriginalFromEntry(MapTrigger.Entry entry)` Extract the value from the "original value" of the passed Entry object.

Methods inherited from class com.tangosol.util.extractor.AbstractCompositeExtractor
`equals, getExtractors, hashCode, readExternal, readExternal, toString, writeExternal, writeExternal`

Methods inherited from class com.tangosol.util.extractor.AbstractExtractor
`compare, compareEntries`

Methods inherited from class com.tangosol.util.BitHelper
`countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString`

Constructor Detail

### ChainedExtractor

    public ChainedExtractor()

  Default constructor (necessary for the ExternalizableLite interface).

### ChainedExtractor

    public ChainedExtractor(ValueExtractor[] aExtractor)

  Construct a ChainedExtractor based on a specified ValueExractor array.
  Parameters:
    `aExtractor` - the ValueExtractor array

### ChainedExtractor

    public ChainedExtractor(ValueExtractor extractor1,
                            ValueExtractor extractor2)

  Construct a ChainedExtractor based on two extractors.
  Parameters:
    `extractor1` - the ValueExtractor
    `extractor2` - the ValueExtractor

### ChainedExtractor

    public ChainedExtractor(java.lang.String sName)

  Construct a ChainedExtractor for a specified method name sequence.
  Parameters:
    `sName` - a dot-delimited sequence of method names which results in a ChainedExtractor that is based on an array of corresponding `ReflectionExtractor` objects

Method Detail

### extract

    public java.lang.Object extract(java.lang.Object oTarget)

  Extract the value from the passed object. The underlying extractors are applied sequentially, so a result of a previous extractor serves as a target object for a next one. A value of null prevents any further extractions and is returned immediately. For intrinsic types, the returned value is expected to be a standard wrapper type in the same manner that reflection works; for example, int would be returned as a java.lang.Integer.
  Specified by:
    `extract` in interface `ValueExtractor`
  Overrides:
    `extract` in class `AbstractExtractor`
  Parameters:
    `oTarget` - an Object to retrieve the value from
  Returns:
    the extracted value as an Object; null is an acceptable value

### extractFromEntry

    public java.lang.Object extractFromEntry(java.util.Map.Entry entry)

  Extract the value from the passed entry. The underlying extractors are applied sequentially, so a result of a previous extractor serves as a target object for a next one. A value of null prevents any further extractions and is returned immediately. For intrinsic types, the returned value is expected to be a standard wrapper type in the same manner that reflection works; for example, int would be returned as a java.lang.Integer.
  Overrides:
    `extractFromEntry` in class `AbstractExtractor`
  Parameters:
    `entry` - an Entry object to extract a desired value from
  Returns:
    the extracted value

### extractOriginalFromEntry

    public java.lang.Object extractOriginalFromEntry(MapTrigger.Entry entry)

  Description copied from class: `AbstractExtractor`
  Extract the value from the "original value" of the passed Entry object. This method's conventions are exactly the same as for the `AbstractExtractor.extractFromEntry(java.util.Map.Entry)` method.
  Overrides:
    `extractOriginalFromEntry` in class `AbstractExtractor`
  Parameters:
    `entry` - an Entry object whose original value should be used to extract the desired value from
  Returns:
    the extracted value or null if the original value is not present

### createExtractors

    public static ValueExtractor[] createExtractors(java.lang.String sName)

  Parse a dot-delimited sequence of method names and instantiate a corresponding array of `ReflectionExtractor` objects.
  Parameters:
    `sName` - a dot-delimited sequence of method names
  Returns:
    an array of `ReflectionExtractor` objects

Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.1.0 E18814-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.