CrackMe.apk
Download file
package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.Multiset;
import com.google.common.primitives.Ints;
import java.util.Comparator;
import javax.annotation.CheckForNull;
@ElementTypesAreNonnullByDefault
final class RegularImmutableSortedMultiset<E> extends ImmutableSortedMultiset<E> {
static final ImmutableSortedMultiset<Comparable> NATURAL_EMPTY_MULTISET = new RegularImmutableSortedMultiset(Ordering.natural());
private static final long[] ZERO_CUMULATIVE_COUNTS = {0};
private final transient long[] cumulativeCounts;
final transient RegularImmutableSortedSet<E> elementSet;
private final transient int length;
private final transient int offset;
RegularImmutableSortedMultiset(Comparator<? super E> comparator) {
this.elementSet = ImmutableSortedSet.emptySet(comparator);
this.cumulativeCounts = ZERO_CUMULATIVE_COUNTS;
this.offset = 0;
this.length = 0;
}
RegularImmutableSortedMultiset(RegularImmutableSortedSet<E> regularImmutableSortedSet, long[] jArr, int i, int i2) {
this.elementSet = regularImmutableSortedSet;
this.cumulativeCounts = jArr;
this.offset = i;
this.length = i2;
}
private int getCount(int i) {
long[] jArr = this.cumulativeCounts;
int i2 = this.offset;
return (int) (jArr[(i2 + i) + 1] - jArr[i2 + i]);
}
/* access modifiers changed from: package-private */
public Multiset.Entry<E> getEntry(int i) {
return Multisets.immutableEntry(this.elementSet.asList().get(i), getCount(i));
}
@CheckForNull
public Multiset.Entry<E> firstEntry() {
if (isEmpty()) {
return null;
}
return getEntry(0);
}
@CheckForNull
public Multiset.Entry<E> lastEntry() {
if (isEmpty()) {
return null;
}
return getEntry(this.length - 1);
}
public int count(@CheckForNull Object obj) {
int indexOf = this.elementSet.indexOf(obj);
if (indexOf >= 0) {
return getCount(indexOf);
}
return 0;
}
public int size() {
long[] jArr = this.cumulativeCounts;
int i = this.offset;
return Ints.saturatedCast(jArr[this.length + i] - jArr[i]);
}
public ImmutableSortedSet<E> elementSet() {
return this.elementSet;
}
public ImmutableSortedMultiset<E> headMultiset(E e, BoundType boundType) {
return getSubMultiset(0, this.elementSet.headIndex(e, Preconditions.checkNotNull(boundType) == BoundType.CLOSED));
}
public ImmutableSortedMultiset<E> tailMultiset(E e, BoundType boundType) {
return getSubMultiset(this.elementSet.tailIndex(e, Preconditions.checkNotNull(boundType) == BoundType.CLOSED), this.length);
}
/* access modifiers changed from: package-private */
public ImmutableSortedMultiset<E> getSubMultiset(int i, int i2) {
Preconditions.checkPositionIndexes(i, i2, this.length);
if (i == i2) {
return emptyMultiset(comparator());
}
if (i == 0 && i2 == this.length) {
return this;
}
return new RegularImmutableSortedMultiset(this.elementSet.getSubSet(i, i2), this.cumulativeCounts, this.offset + i, i2 - i);
}
/* access modifiers changed from: package-private */
public boolean isPartialView() {
return this.offset > 0 || this.length < this.cumulativeCounts.length - 1;
}
}
Download file