Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.

Ensures that the receiver can hold at least the specified number of associations without needing to allocate new
internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver.

This
method never need be called; it is for performance tuning only. Calling this method before put()ing a
large number of associations boosts performance, because the receiver will grow only once instead of potentially
many times and hash collisions get less probable.

Applies a procedure to each key of the receiver, if any. Note: Iterates over the keys in no particular order.
Subclasses can define a particular order, for example, "sorted by key". All methods which can be expressed
in terms of this method (most methods can) must guarantee to use the same order defined by this
method, even if it is no particular order. This is necessary so that, for example, methods keys and
values will yield association pairs, not two uncorrelated lists.

Parameters:

procedure the procedure to be applied. Stops iteration if the procedure returns false, otherwise
continues.

Returns:

false if the procedure stopped before all keys where iterated over, true otherwise.

Returns the value associated with the specified key. It is often a good idea to first check with
containsKey(int) whether the given key has a value associated or not, i.e. whether there exists an association
for the given key or not.

Parameters:

key the key to be searched for.

Returns:

the value associated with the specified key; 0 if no such key is present.

the index where the key would need to be inserted, if it is not already contained. Returns -index-1 if the
key is already contained at slot index. Therefore, if the returned index < 0, then it is already contained
at slot -index-1. If the returned index >= 0, then it is NOT already contained and should be inserted at
slot index.

Fills all keys contained in the receiver into the specified list. Fills the list, starting at index 0. After this
call returns the specified list has a new size that equals this.size(). Iteration order is guaranteed to
be identical to the order used by method forEachKey(org.apache.mahout.math.function.IntProcedure).

Fills all pairs satisfying a given condition into the specified lists. Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size, the number of pairs satisfying the condition.
Iteration order is guaranteed to be identical to the order used by method forEachKey(org.apache.mahout.math.function.IntProcedure).

Rehashes the contents of the receiver into a new table with a smaller or larger capacity. This method is called
automatically when the number of keys in the receiver exceeds the high water mark or falls below the low water
mark.

Fills all values contained in the receiver into the specified list. Fills the list, starting at index 0. After this
call returns the specified list has a new size that equals this.size(). Iteration order is guaranteed to
be identical to the order used by method forEachKey(org.apache.mahout.math.function.IntProcedure).