net.sf.jagg.msd
Class NullDiscriminator<T>
java.lang.Object
net.sf.jagg.msd.AbstractDiscriminator<T>
net.sf.jagg.msd.NullDiscriminator<T>
- All Implemented Interfaces:
- Discriminator<T>
public class NullDiscriminator<T>
- extends AbstractDiscriminator<T>
A NullDiscriminator
extracts nulls
into a separate
equivalence class, then calls another discriminator.
- Since:
- 0.5.0
- Author:
- Randy Gettman
Constructor Summary |
NullDiscriminator(Discriminator<T> discriminator)
Create a NullDiscriminator that decorates another
Discriminator , to allow null labels. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NullDiscriminator
public NullDiscriminator(Discriminator<T> discriminator)
- Create a
NullDiscriminator
that decorates another
Discriminator
, to allow null
labels.
- Parameters:
discriminator
- Another Discriminator
.
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.
Copyright © 2010-2013 jAgg Team. All Rights Reserved.