|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.msd.util.AbstractDiscriminator<List<T>>
org.planx.msd.list.ShortBagDiscriminator<T>
public class ShortBagDiscriminator<T>
A Discriminator capable of discriminating a multiset of
Lists considered as bags. That is, two lists are considered
equivalent if one is a permutation of the other.
This implementation uses a ShortArrayDiscriminator to
discriminate the lists after they have been weak sorted and elements
replaced by short tokens. This gives the restriction
that there must be at most 2^16 different elements
(equivalence classes) in the input.
Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, it must be synchronized externally.
| Constructor Summary | |
|---|---|
ShortBagDiscriminator(Discriminator<T> d,
Memory memory)
Constructs a new ShortBagDiscriminator where the
specified Discriminator is capable of discriminating
the elements contained in the bags. |
|
| Method Summary | ||
|---|---|---|
|
discriminate(List<? extends U> values,
Extractor<U,? extends List<T>,S> e)
Discriminates a List of values using an Extractor,
and returns a Collection of Lists, each
representing an equivalence class containing elements from
values that are equivalent. |
|
| Methods inherited from class org.planx.msd.util.AbstractDiscriminator |
|---|
discriminate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShortBagDiscriminator(Discriminator<T> d,
Memory memory)
ShortBagDiscriminator where the
specified Discriminator is capable of discriminating
the elements contained in the bags. The instance will reuse the
memory of the specified Memory.
| Method Detail |
|---|
public <U,S> Collection<List<S>> discriminate(List<? extends U> values,
Extractor<U,? extends List<T>,S> e)
DiscriminatorList of values using an Extractor,
and returns a Collection of Lists, each
representing an equivalence class containing elements from
values that are equivalent.
The Extractor performs the task of extracting two kinds
of objects from the input values: The label which
is the object equivalence is defined upon, and the value which
is the object that will be returned. That is, the label
determines which equivalence class the value goes into.
The Collection of Lists returned should be
considered unmodifiable (though, in some cases they might actually be
modifiable, but this behaviour should not be relied upon).
discriminate in interface Discriminator<List<T>>discriminate in class AbstractDiscriminator<List<T>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||