net.sf.jagg.msd
Class CharacterDiscriminator

java.lang.Object
  extended by net.sf.jagg.msd.AbstractDiscriminator<T>
      extended by net.sf.jagg.msd.PortionDiscriminator<java.lang.Character>
          extended by net.sf.jagg.msd.CharacterDiscriminator
All Implemented Interfaces:
Discriminator<java.lang.Character>

public class CharacterDiscriminator
extends PortionDiscriminator<java.lang.Character>

A CharacterDiscriminator discriminates Lists of Characters.

Since:
0.5.0
Author:
Randy Gettman

Nested Class Summary
protected  class CharacterDiscriminator.CharExtractor<E>
          A CharExtractor extracts integer labels by converting the character into an integer.
 
Constructor Summary
CharacterDiscriminator()
           
 
Method Summary
<E> java.util.List<java.util.List<E>>
discriminate(java.util.List<E> elements, Extractor<E,java.lang.Character> extractor, MsdWorkspace workspace)
          Partitions the given List of values into another List, in which all of the values from the given list exist in the new list, and all values that compare equal are adjacent to each other, according to the given Extractor.
protected
<E> CharacterDiscriminator.CharExtractor<E>
getPortionExtractor(Extractor<E,java.lang.Character> e)
          Returns a portion extractor appropriate for Characters.
 
Methods inherited from class net.sf.jagg.msd.PortionDiscriminator
discriminatePortion
 
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

CharacterDiscriminator

public CharacterDiscriminator()
Method Detail

discriminate

public <E> java.util.List<java.util.List<E>> discriminate(java.util.List<E> elements,
                                                          Extractor<E,java.lang.Character> extractor,
                                                          MsdWorkspace workspace)
Partitions the given List of values into another List, in which all of the values from the given list exist in the new list, and all values that compare equal are adjacent to each other, according to the given Extractor.

Specified by:
discriminate in interface Discriminator<java.lang.Character>
Overrides:
discriminate in class PortionDiscriminator<java.lang.Character>
Type Parameters:
E - The type of element that is being discriminated by the type <E>
Parameters:
elements - A List of elements.
extractor - An Extractor that gives labels for each element.
workspace - The MsdWorkspace used in the discrimination process.
Returns:
A List of Lists containing all equivalence classes. Each equivalence class list contains all values that compare equal to each other.

getPortionExtractor

protected <E> CharacterDiscriminator.CharExtractor<E> getPortionExtractor(Extractor<E,java.lang.Character> e)
Returns a portion extractor appropriate for Characters.

Specified by:
getPortionExtractor in class PortionDiscriminator<java.lang.Character>
Type Parameters:
E - The type of the element.
Parameters:
e - An Extractor that returns appropriate labels.
Returns:
An appropriate PortionExtractor.


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