net.sf.jagg.msd
Class PortionExtractor<E,T>
java.lang.Object
net.sf.jagg.msd.AbstractExtractor<E,T>
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
.
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.