|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.msd.util.AbstractDiscriminator<T>
org.planx.msd.util.DiscriminatorAdapter<T,E>
public abstract class DiscriminatorAdapter<T,E>
This class provides a skeletal implementation of a
Discriminator that adapts its input to suit that of
another Discriminator.
The type arguments T and E corresponds to
the type adapted from and the type adapted to, respectively. The
implementation need only provide a transform(T) method.
| Constructor Summary | |
|---|---|
DiscriminatorAdapter(Discriminator<E> d)
Constructs a new DiscriminatorAdapter which adapts
its input to the specified Discriminator. |
|
| Method Summary | ||
|---|---|---|
|
discriminate(List<? extends U> values,
Extractor<U,? extends 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. |
|
protected abstract E |
transform(T value)
Transform a value of the input type T to the type
E expected as input to the wrapped
Discriminator. |
|
| 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 DiscriminatorAdapter(Discriminator<E> d)
DiscriminatorAdapter which adapts
its input to the specified Discriminator.
| Method Detail |
|---|
public <U,S> Collection<List<S>> discriminate(List<? extends U> values,
Extractor<U,? extends 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<T>discriminate in class AbstractDiscriminator<T>protected abstract E transform(T value)
T to the type
E expected as input to the wrapped
Discriminator.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||