net.sf.jagg.msd
Class ClassDiscriminator<T>

java.lang.Object
  extended by net.sf.jagg.msd.AbstractDiscriminator<T>
      extended by net.sf.jagg.msd.ChainedDiscriminator<T>
          extended by net.sf.jagg.msd.ClassDiscriminator<T>
All Implemented Interfaces:
Discriminator<T>

public class ClassDiscriminator<T>
extends ChainedDiscriminator<T>

A ClassDiscriminator discriminates Lists of Objects by their class names.

Since:
0.5.0
Author:
Randy Gettman

Nested Class Summary
protected  class ClassDiscriminator.ClassChainedExtractor<E,B>
          A ClassChainedExtractor extracts the class name.
 
Constructor Summary
ClassDiscriminator()
           
 
Method Summary
protected
<E> ChainedExtractor<E,java.lang.String,T>
getChainedExtractor(java.util.List<E> elements, Extractor<E,T> extractor)
          Returns an appropriate ChainedExtractor.
protected
<E> Discriminator<java.lang.String>
getDiscriminator(java.util.List<E> elements, ChainedExtractor<E,?,T> extractor, int index)
          Returns the Discriminator that discriminates on the class name of the objects.
 
Methods inherited from class net.sf.jagg.msd.ChainedDiscriminator
discriminate
 
Methods inherited from class net.sf.jagg.msd.AbstractDiscriminator
discriminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassDiscriminator

public ClassDiscriminator()
Method Detail

getChainedExtractor

protected <E> ChainedExtractor<E,java.lang.String,T> getChainedExtractor(java.util.List<E> elements,
                                                                         Extractor<E,T> extractor)
Returns an appropriate ChainedExtractor.

Specified by:
getChainedExtractor in class ChainedDiscriminator<T>
Type Parameters:
E - The type of element.
Parameters:
elements - The List of elements.
extractor - A ChainedExtractor that returns appropriate labels.
Returns:
An appropriate ChainedExtractor.
See Also:
ChainedDiscriminator.getDiscriminator(java.util.List, net.sf.jagg.msd.ChainedExtractor, int)

getDiscriminator

protected <E> Discriminator<java.lang.String> getDiscriminator(java.util.List<E> elements,
                                                               ChainedExtractor<E,?,T> extractor,
                                                               int index)
Returns the Discriminator that discriminates on the class name of the objects.

Specified by:
getDiscriminator in class ChainedDiscriminator<T>
Parameters:
elements - The list of elements.
extractor - The ChainedExtractor that was obtained from getChainedExtractor.
index - The index of the loop.
Returns:
A Discriminator that discriminates on the class name of the objects.
See Also:
ChainedDiscriminator.getChainedExtractor(java.util.List, net.sf.jagg.msd.Extractor)


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