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

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

public class DiscriminableDiscriminator<T>
extends AbstractDiscriminator<T>

A DiscriminableDiscriminator assumes that the type of elements is Discriminable. It extracts the properties, then delegates to a PropertiesDiscriminator.

Since:
0.5.0
Author:
Randy Gettman
See Also:
PropertiesDiscriminator

Constructor Summary
DiscriminableDiscriminator()
           
 
Method Summary
<E> java.util.List<java.util.List<E>>
discriminate(java.util.List<E> elements, Extractor<E,T> extractor, MsdWorkspace workspace)
          Partitions the given List of elements into another List, in which all of the elements from the given list exist in the new list, and all elements that compare equal are adjacent to each other, according to the given Extractor.
 
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

DiscriminableDiscriminator

public DiscriminableDiscriminator()
Method Detail

discriminate

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

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 elements that compare equal to each other.
Throws:
java.lang.ClassCastException - If an encountered object was not Discriminable.
See Also:
Discriminable


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