diff options
Diffstat (limited to 'guava/src/com/google/common/hash/AbstractCompositeHashFunction.java')
-rw-r--r-- | guava/src/com/google/common/hash/AbstractCompositeHashFunction.java | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/guava/src/com/google/common/hash/AbstractCompositeHashFunction.java b/guava/src/com/google/common/hash/AbstractCompositeHashFunction.java index 6a0f452..41c4836 100644 --- a/guava/src/com/google/common/hash/AbstractCompositeHashFunction.java +++ b/guava/src/com/google/common/hash/AbstractCompositeHashFunction.java @@ -1,42 +1,23 @@ -/* - * Copyright (C) 2011 The Guava Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2011 Google Inc. All Rights Reserved. package com.google.common.hash; -import static com.google.common.base.Preconditions.checkNotNull; - import java.nio.charset.Charset; /** * An abstract composition of multiple hash functions. {@linkplain #newHasher()} delegates to the * {@code Hasher} objects of the delegate hash functions, and in the end, they are used by * {@linkplain #makeHash(Hasher[])} that constructs the final {@code HashCode}. - * - * @author Dimitris Andreou + * + * @author andreou@google.com (Dimitris Andreou) */ abstract class AbstractCompositeHashFunction extends AbstractStreamingHashFunction { final HashFunction[] functions; - + AbstractCompositeHashFunction(HashFunction... functions) { - for (HashFunction function : functions) { - checkNotNull(function); - } this.functions = functions; } - + /** * Constructs a {@code HashCode} from the {@code Hasher} objects of the functions. Each of them * has consumed the entire input and they are ready to output a {@code HashCode}. The order of @@ -44,7 +25,7 @@ abstract class AbstractCompositeHashFunction extends AbstractStreamingHashFuncti */ // this could be cleaner if it passed HashCode[], but that would create yet another array... /* protected */ abstract HashCode makeHash(Hasher[] hashers); - + @Override public Hasher newHasher() { final Hasher[] hashers = new Hasher[functions.length]; @@ -148,6 +129,6 @@ abstract class AbstractCompositeHashFunction extends AbstractStreamingHashFuncti } }; } - + private static final long serialVersionUID = 0L; } |