package com.google.common.hash; import com.google.common.base.Preconditions; import java.nio.ByteBuffer; import java.nio.charset.Charset; /* loaded from: classes2.dex */ abstract class AbstractCompositeHashFunction extends AbstractHashFunction { private static final long serialVersionUID = 0; final HashFunction[] functions; abstract HashCode makeHash(Hasher[] hasherArr); /* JADX INFO: Access modifiers changed from: package-private */ public AbstractCompositeHashFunction(HashFunction... hashFunctionArr) { for (HashFunction hashFunction : hashFunctionArr) { Preconditions.checkNotNull(hashFunction); } this.functions = hashFunctionArr; } @Override // com.google.common.hash.HashFunction public Hasher newHasher() { int length = this.functions.length; Hasher[] hasherArr = new Hasher[length]; for (int i = 0; i < length; i++) { hasherArr[i] = this.functions[i].newHasher(); } return fromHashers(hasherArr); } @Override // com.google.common.hash.AbstractHashFunction, com.google.common.hash.HashFunction public Hasher newHasher(int i) { Preconditions.checkArgument(i >= 0); int length = this.functions.length; Hasher[] hasherArr = new Hasher[length]; for (int i2 = 0; i2 < length; i2++) { hasherArr[i2] = this.functions[i2].newHasher(i); } return fromHashers(hasherArr); } private Hasher fromHashers(Hasher[] hasherArr) { return new Hasher(this, hasherArr) { // from class: com.google.common.hash.AbstractCompositeHashFunction.1 final AbstractCompositeHashFunction this$0; final Hasher[] val$hashers; { this.this$0 = this; this.val$hashers = hasherArr; } @Override // com.google.common.hash.PrimitiveSink public Hasher putByte(byte b) { for (Hasher hasher : this.val$hashers) { hasher.putByte(b); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putBytes(byte[] bArr) { for (Hasher hasher : this.val$hashers) { hasher.putBytes(bArr); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putBytes(byte[] bArr, int i, int i2) { for (Hasher hasher : this.val$hashers) { hasher.putBytes(bArr, i, i2); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putBytes(ByteBuffer byteBuffer) { int position = byteBuffer.position(); for (Hasher hasher : this.val$hashers) { Java8Compatibility.position(byteBuffer, position); hasher.putBytes(byteBuffer); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putShort(short s) { for (Hasher hasher : this.val$hashers) { hasher.putShort(s); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putInt(int i) { for (Hasher hasher : this.val$hashers) { hasher.putInt(i); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putLong(long j) { for (Hasher hasher : this.val$hashers) { hasher.putLong(j); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putFloat(float f) { for (Hasher hasher : this.val$hashers) { hasher.putFloat(f); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putDouble(double d) { for (Hasher hasher : this.val$hashers) { hasher.putDouble(d); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putBoolean(boolean z) { for (Hasher hasher : this.val$hashers) { hasher.putBoolean(z); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putChar(char c) { for (Hasher hasher : this.val$hashers) { hasher.putChar(c); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putUnencodedChars(CharSequence charSequence) { for (Hasher hasher : this.val$hashers) { hasher.putUnencodedChars(charSequence); } return this; } @Override // com.google.common.hash.PrimitiveSink public Hasher putString(CharSequence charSequence, Charset charset) { for (Hasher hasher : this.val$hashers) { hasher.putString(charSequence, charset); } return this; } @Override // com.google.common.hash.Hasher public Hasher putObject(T t, Funnel funnel) { for (Hasher hasher : this.val$hashers) { hasher.putObject(t, funnel); } return this; } @Override // com.google.common.hash.Hasher public HashCode hash() { return this.this$0.makeHash(this.val$hashers); } }; } }