Oracle® Coherence Java API Reference
v3.5

E14977-01

com.tangosol.util.extractor
Class ChainedExtractor

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper
              extended by com.tangosol.util.extractor.AbstractExtractor
                  extended by com.tangosol.util.extractor.AbstractCompositeExtractor
                      extended by 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.
 
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

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

Oracle® Coherence Java API Reference
v3.5

E14977-01

Copyright © 2000, 2009, Oracle. All rights reserved.