|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.utilities.pairs.PairUtil
public final class PairUtil
Utility functions for (boxed) Pair classes.
Nested Class Summary | |
---|---|
static class |
PairUtil.Compare<FIRST,SECOND>
Compare two SimplePairs based on two comparators |
static class |
PairUtil.CompareByFirst<FIRST,SECOND>
Compare two SimplePairs based on a comparator for the first component. |
static class |
PairUtil.CompareBySecond<FIRST,SECOND>
Compare two SimplePairs based on a comparator for the second component. |
static class |
PairUtil.CompareNatural<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>
Class to do a "natural order" comparison on this class. |
static class |
PairUtil.CompareNaturalFirst<FIRST extends Comparable<? super FIRST>,SECOND>
Class to do a natural comparison on this class' first component. |
static class |
PairUtil.CompareNaturalSecond<FIRST,SECOND extends Comparable<? super SECOND>>
Class to do a natural comparison on this class' second component. |
static class |
PairUtil.CompareNaturalSwapped<FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>>
Class to do a canonical swapped comparison on this class. |
static class |
PairUtil.CompareSwapped<FIRST,SECOND>
Compare two SimplePairs based on two comparators, but by second component first. |
Constructor Summary | |
---|---|
PairUtil()
|
Method Summary | ||
---|---|---|
static
|
comparator()
Return a comparator for this pair, given that both components are already comparable. |
|
static
|
comparator(Comparator<? super FIRST> c1,
Comparator<? super SECOND> c2)
Return a derived comparator given a comparator for each component. |
|
static
|
comparatorFirst()
Return a comparator by first component for this pair, given that the first component is already comparable. |
|
static
|
comparatorFirst(Comparator<? super FIRST> c1)
Return a derived comparator by first component given a comparator for this component. |
|
static
|
comparatorSecond()
Return a comparator by first component for this pair, given that the first component is already comparable. |
|
static
|
comparatorSecond(Comparator<? super SECOND> c2)
Return a derived comparator by first component given a comparator for this component. |
|
static
|
comparatorSwapped()
Return a component-swapped comparator for this pair, given that both components are already comparable. |
|
static
|
comparatorSwapped(Comparator<? super FIRST> c1,
Comparator<? super SECOND> c2)
Return a derived component-swapped comparator given a comparator for each component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PairUtil()
Method Detail |
---|
public static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparator()
FIRST
- First typeSECOND
- Second type
public static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparator(Comparator<? super FIRST> c1, Comparator<? super SECOND> c2)
FIRST
- First typeSECOND
- Second typec1
- First comparatorc2
- Second comparator
public static <FIRST extends Comparable<? super FIRST>,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorFirst()
FIRST
- First typeSECOND
- Second type
public static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorFirst(Comparator<? super FIRST> c1)
FIRST
- First typeSECOND
- Second typec1
- Comparator for first
public static <FIRST,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSecond()
FIRST
- First typeSECOND
- Second type
public static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSecond(Comparator<? super SECOND> c2)
FIRST
- First typeSECOND
- Second typec2
- Comparator for second
public static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSwapped()
FIRST
- First typeSECOND
- Second type
public static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSwapped(Comparator<? super FIRST> c1, Comparator<? super SECOND> c2)
FIRST
- First typeSECOND
- Second typec1
- First comparatorc2
- Second comparator
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |