what-the-bank/sources/com/google/common/collect/StandardRowSortedTable.java

100 lines
3.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.collect.Maps;
import com.google.common.collect.StandardTable;
import java.util.Comparator;
import java.util.Map;
import java.util.SortedMap;
import java.util.SortedSet;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public class StandardRowSortedTable<R, C, V> extends StandardTable<R, C, V> implements RowSortedTable<R, C, V> {
private static final long serialVersionUID = 0;
/* JADX INFO: Access modifiers changed from: package-private */
public StandardRowSortedTable(SortedMap<R, Map<C, V>> sortedMap, Supplier<? extends Map<C, V>> supplier) {
super(sortedMap, supplier);
}
/* JADX INFO: Access modifiers changed from: private */
public SortedMap<R, Map<C, V>> sortedBackingMap() {
return (SortedMap) this.backingMap;
}
@Override // com.google.common.collect.StandardTable, com.google.common.collect.AbstractTable, com.google.common.collect.Table
public SortedSet<R> rowKeySet() {
return (SortedSet) rowMap().keySet();
}
@Override // com.google.common.collect.StandardTable, com.google.common.collect.Table
public SortedMap<R, Map<C, V>> rowMap() {
return (SortedMap) super.rowMap();
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.StandardTable
public SortedMap<R, Map<C, V>> createRowMap() {
return new RowSortedMap();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public class RowSortedMap extends StandardTable.RowMap implements SortedMap {
final StandardRowSortedTable this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
private RowSortedMap(StandardRowSortedTable standardRowSortedTable) {
super(standardRowSortedTable);
this.this$0 = standardRowSortedTable;
}
@Override // com.google.common.collect.Maps.ViewCachingAbstractMap, java.util.AbstractMap, java.util.Map
public SortedSet<R> keySet() {
return (SortedSet) super.keySet();
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.Maps.ViewCachingAbstractMap
public SortedSet<R> createKeySet() {
return new Maps.SortedKeySet(this);
}
@Override // java.util.SortedMap
public Comparator<? super R> comparator() {
return this.this$0.sortedBackingMap().comparator();
}
@Override // java.util.SortedMap
public R firstKey() {
return (R) this.this$0.sortedBackingMap().firstKey();
}
@Override // java.util.SortedMap
public R lastKey() {
return (R) this.this$0.sortedBackingMap().lastKey();
}
@Override // java.util.SortedMap
public SortedMap<R, Map<C, V>> headMap(R r) {
Preconditions.checkNotNull(r);
return new StandardRowSortedTable(this.this$0.sortedBackingMap().headMap(r), this.this$0.factory).rowMap();
}
@Override // java.util.SortedMap
public SortedMap<R, Map<C, V>> subMap(R r, R r2) {
Preconditions.checkNotNull(r);
Preconditions.checkNotNull(r2);
return new StandardRowSortedTable(this.this$0.sortedBackingMap().subMap(r, r2), this.this$0.factory).rowMap();
}
@Override // java.util.SortedMap
public SortedMap<R, Map<C, V>> tailMap(R r) {
Preconditions.checkNotNull(r);
return new StandardRowSortedTable(this.this$0.sortedBackingMap().tailMap(r), this.this$0.factory).rowMap();
}
}
}