|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.msd.Discriminators
public final class Discriminators
Utility class that provides methods for common discriminator tasks.
| Constructor Summary | |
|---|---|
Discriminators()
|
|
| Method Summary | ||
|---|---|---|
static
|
discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,S> e2)
|
|
static
|
discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,U> e2,
Discriminator<C> d3,
Extractor<U,? extends C,S> e3)
|
|
static
|
discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,U> e2,
Discriminator<C> d3,
Extractor<U,? extends C,U> e3,
Discriminator<D> d4,
Extractor<U,? extends D,S> e4)
|
|
static boolean |
equals(CharSequence c1,
CharSequence c2)
Efficient equivalence testing of two CharSequences. |
|
static
|
equals(E o1,
E o2,
Discriminator<E> d)
Returns true if and only if o1 and
o2 are equivalent under the equivalence defined by
the specified Discriminator. |
|
static
|
identityExtractor()
Returns an Extractor where the label and value are
identical to the original value. |
|
static
|
identityExtractor(Extractor<U,T,?> e)
Returns an Extractor where the label is extracted by
the specified Extractor and the value is just the
original value. |
|
static
|
pairExtractor()
Returns an Extractor that extracts the first component
of a Pair as the label and the second component as the
value. |
|
static
|
pairFirstExtractor()
Returns an Extractor that extracts the first component
of a Pair as the label and the whole pair as the value. |
|
static
|
pairFlipExtractor()
Returns an Extractor that extracts the first component
of a Pair as the value and the second component as the
label. |
|
static
|
pairSecondExtractor()
Returns an Extractor that extracts the second component
of a Pair as the label and the whole pair as the value. |
|
static
|
valueList(List<? extends U> list,
Extractor<U,?,S> e)
Returns a List containing the values (as determined by
the Extractor
e) of the specified List. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Discriminators()
| Method Detail |
|---|
public static <E> boolean equals(E o1,
E o2,
Discriminator<E> d)
true if and only if o1 and
o2 are equivalent under the equivalence defined by
the specified Discriminator.
public static boolean equals(CharSequence c1,
CharSequence c2)
CharSequences.
Equivalence on the CharSequences is defined as the
standard equality, where two sequences are equal if and only if
they have the same length and their elements are pair-wise equal.
public static <T> Extractor<T,T,T> identityExtractor()
Extractor where the label and value are
identical to the original value.
public static <U,T> Extractor<U,T,U> identityExtractor(Extractor<U,T,?> e)
Extractor where the label is extracted by
the specified Extractor and the value is just the
original value.
public static <T,S,P extends Pair<T,S>> Extractor<P,T,S> pairExtractor()
Extractor that extracts the first component
of a Pair as the label and the second component as the
value.
public static <T,S,P extends Pair<T,S>> Extractor<P,S,T> pairFlipExtractor()
Extractor that extracts the first component
of a Pair as the value and the second component as the
label.
public static <T,P extends Pair<T,?>> Extractor<P,T,P> pairFirstExtractor()
Extractor that extracts the first component
of a Pair as the label and the whole pair as the value.
public static <S,P extends Pair<?,S>> Extractor<P,S,P> pairSecondExtractor()
Extractor that extracts the second component
of a Pair as the label and the whole pair as the value.
public static <U,S> List<S> valueList(List<? extends U> list,
Extractor<U,?,S> e)
List containing the values (as determined by
the Extractor
e) of the specified List.
public static <U,S,A,B> Collection<List<S>> discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,S> e2)
public static <U,S,A,B,C> Collection<List<S>> discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,U> e2,
Discriminator<C> d3,
Extractor<U,? extends C,S> e3)
public static <U,S,A,B,C,D> Collection<List<S>> discriminate(List<? extends U> values,
Discriminator<A> d1,
Extractor<U,? extends A,U> e1,
Discriminator<B> d2,
Extractor<U,? extends B,U> e2,
Discriminator<C> d3,
Extractor<U,? extends C,U> e3,
Discriminator<D> d4,
Extractor<U,? extends D,S> e4)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||