68 lines
2.1 KiB
Java
68 lines
2.1 KiB
Java
|
package o;
|
||
|
|
||
|
import java.util.Collections;
|
||
|
import java.util.Comparator;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class xNZ<T> implements Comparator<T> {
|
||
|
private final Comparator<? super T> b;
|
||
|
|
||
|
static {
|
||
|
new xNZ(new Comparator<Comparable<Object>>() { // from class: o.xNZ.2
|
||
|
@Override // java.util.Comparator
|
||
|
public final /* synthetic */ int compare(Comparable<Object> comparable, Comparable<Object> comparable2) {
|
||
|
return comparable.compareTo(comparable2);
|
||
|
}
|
||
|
});
|
||
|
new xNZ(Collections.reverseOrder());
|
||
|
}
|
||
|
|
||
|
public static <T, U extends Comparable<? super U>> xNZ<T> a(InterfaceC1244Ytw<? super T, ? extends U> interfaceC1244Ytw) {
|
||
|
return new xNZ<>(new Comparator<T>(interfaceC1244Ytw) { // from class: o.xNZ.4
|
||
|
private InterfaceC1244Ytw a;
|
||
|
|
||
|
{
|
||
|
this.a = interfaceC1244Ytw;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.Comparator
|
||
|
public final int compare(T t, T t2) {
|
||
|
return ((Comparable) this.a.d(t)).compareTo((Comparable) this.a.d(t2));
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
private xNZ(Comparator<? super T> comparator) {
|
||
|
this.b = comparator;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.Comparator
|
||
|
public final int compare(T t, T t2) {
|
||
|
return this.b.compare(t, t2);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.Comparator
|
||
|
public final /* synthetic */ Comparator reversed() {
|
||
|
return new xNZ(Collections.reverseOrder(this.b));
|
||
|
}
|
||
|
|
||
|
@Override // java.util.Comparator
|
||
|
public final /* synthetic */ Comparator thenComparing(Comparator comparator) {
|
||
|
return new xNZ(new Comparator<T>(this, comparator) { // from class: o.xNZ.5
|
||
|
private xNZ b;
|
||
|
private Comparator d;
|
||
|
|
||
|
{
|
||
|
this.b = this;
|
||
|
this.d = comparator;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.Comparator
|
||
|
public final int compare(T t, T t2) {
|
||
|
int compare = this.b.b.compare(t, t2);
|
||
|
return compare == 0 ? this.d.compare(t, t2) : compare;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|