net.sf.jagg.msd
Class PortionExtractor<E,T>

java.lang.Object
  extended by net.sf.jagg.msd.AbstractExtractor<E,T>
      extended by net.sf.jagg.msd.PortionExtractor<E,T>
Type Parameters:
E - The element type, matching Extractor.
T - The label type from a chained Extractor, from which this can generate a new label of type int.
Direct Known Subclasses:
CharacterDiscriminator.CharExtractor, CharSequenceDiscriminator.CharPortionExtractor

public abstract class PortionExtractor<E,T>
extends AbstractExtractor<E,T>

A PortionExtractor extracts a portion of an element and returns it as the label. It relies on labels from a chained Extractor so it can produce its own labels based on the Extractor's labels. It does NOT implement the Extractor interface, so that it can produce int labels (The primitive type int cannot be a type parameter.) Many subclasses of PortionExtractor are anonymous subclasses defined within Discriminators.

Since:
0.5.0
Author:
Randy Gettman

Field Summary
 
Fields inherited from class net.sf.jagg.msd.AbstractExtractor
amIAllComplete, myExtractor, myIndex
 
Constructor Summary
PortionExtractor(Extractor<E,T> extractor)
          Creates an PortionExtractor that uses the given Extractor in a chain for its labels.
 
Method Summary
abstract  int getLabel(E element)
          Returns the label for a given element.
 
Methods inherited from class net.sf.jagg.msd.AbstractExtractor
isAllComplete, isComplete, setAllComplete, setIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortionExtractor

public PortionExtractor(Extractor<E,T> extractor)
Creates an PortionExtractor that uses the given Extractor in a chain for its labels.

Parameters:
extractor - The chained Extractor.
Method Detail

getLabel

public abstract int getLabel(E element)
Returns the label for a given element.

Parameters:
element - The element.
Returns:
The label, as an int.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.