public final class PairUtil extends Object
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
PairUtil() |
Modifier and Type | Method and Description |
---|---|
static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> |
comparator()
Return a comparator for this pair, given that both components are already
comparable.
|
static <FIRST,SECOND> |
comparator(Comparator<? super FIRST> c1,
Comparator<? super SECOND> c2)
Return a derived comparator given a comparator for each component.
|
static <FIRST extends Comparable<? super FIRST>,SECOND> |
comparatorFirst()
Return a comparator by first component for this pair, given that the first
component is already comparable.
|
static <FIRST,SECOND> |
comparatorFirst(Comparator<? super FIRST> c1)
Return a derived comparator by first component given a comparator for this
component.
|
static <FIRST,SECOND extends Comparable<? super SECOND>> |
comparatorSecond()
Return a comparator by first component for this pair, given that the first
component is already comparable.
|
static <FIRST,SECOND> |
comparatorSecond(Comparator<? super SECOND> c2)
Return a derived comparator by first component given a comparator for this
component.
|
static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> |
comparatorSwapped()
Return a component-swapped comparator for this pair, given that both
components are already comparable.
|
static <FIRST,SECOND> |
comparatorSwapped(Comparator<? super FIRST> c1,
Comparator<? super SECOND> c2)
Return a derived component-swapped comparator given a comparator for each
component.
|
public static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparator()
FIRST
- First typeSECOND
- Second typepublic 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 comparatorpublic static <FIRST extends Comparable<? super FIRST>,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorFirst()
FIRST
- First typeSECOND
- Second typepublic static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorFirst(Comparator<? super FIRST> c1)
FIRST
- First typeSECOND
- Second typec1
- Comparator for firstpublic static <FIRST,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSecond()
FIRST
- First typeSECOND
- Second typepublic static <FIRST,SECOND> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSecond(Comparator<? super SECOND> c2)
FIRST
- First typeSECOND
- Second typec2
- Comparator for secondpublic static <FIRST extends Comparable<? super FIRST>,SECOND extends Comparable<? super SECOND>> Comparator<Pair<? extends FIRST,? extends SECOND>> comparatorSwapped()
FIRST
- First typeSECOND
- Second typepublic 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