com.hazelcast.util.collection

## Class BiInt2ObjectMap<V>

- java.lang.Object
- - com.hazelcast.util.collection.BiInt2ObjectMap<V>

- Type Parameters:
    `V` - type of the object stored in the map.

      public class BiInt2ObjectMap<V>
      extends Object

  Map that takes two part int key and associates with an object.

  The underlying implementation use as `Long2ObjectHashMap` and combines both int keys into a long key.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `BiInt2ObjectMap.EntryConsumer<V>` Handler for a map entry

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BiInt2ObjectMap()` Construct an empty map
    `BiInt2ObjectMap(int initialCapacity, double loadFactor)` See `Long2ObjectHashMap.Long2ObjectHashMap(int, double)`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `capacity()` Get the total capacity for the map to which the load factor with be a fraction of.
    `void` | `forEach(BiInt2ObjectMap.EntryConsumer<V> consumer)` Iterate over the entries of the map
    `void` | `forEach(Consumer<V> consumer)` Iterate over the values in the map
    `V` | `get(int keyPartA, int keyPartB)` Retrieve a value from the map.
    `boolean` | `isEmpty()` Is map empty or not.
    `double` | `loadFactor()` Get the load factor beyond which the map will increase size.
    `V` | `put(int keyPartA, int keyPartB, V value)` Put a value into the map.
    `V` | `remove(int keyPartA, int keyPartB)` Remove a value from the map and return the value.
    `int` | `size()` Return the number of unique entries in the map.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BiInt2ObjectMap

          public BiInt2ObjectMap()

      Construct an empty map

    - #### BiInt2ObjectMap

          public BiInt2ObjectMap(int initialCapacity,
                                 double loadFactor)

      See `Long2ObjectHashMap.Long2ObjectHashMap(int, double)`.
      Parameters:
        `initialCapacity` - for the underlying hash map
        `loadFactor` - for the underlying hash map

  - ### Method Detail

    - #### capacity

          public int capacity()

      Get the total capacity for the map to which the load factor with be a fraction of.
      Returns:
        the total capacity for the map.

    - #### loadFactor

          public double loadFactor()

      Get the load factor beyond which the map will increase size.
      Returns:
        load factor for when the map should increase size.

    - #### put

          public V put(int keyPartA,
                       int keyPartB,
                       V value)

      Put a value into the map.
      Parameters:
        `keyPartA` - for the key
        `keyPartB` - for the key
        `value` - to put into the map
      Returns:
        the previous value if found otherwise null

    - #### get

          public V get(int keyPartA,
                       int keyPartB)

      Retrieve a value from the map.
      Parameters:
        `keyPartA` - for the key
        `keyPartB` - for the key
      Returns:
        value matching the key if found or null if not found.

    - #### remove

          public V remove(int keyPartA,
                          int keyPartB)

      Remove a value from the map and return the value.
      Parameters:
        `keyPartA` - for the key
        `keyPartB` - for the key
      Returns:
        the previous value if found otherwise null

    - #### forEach

          public void forEach(BiInt2ObjectMap.EntryConsumer<V> consumer)

      Iterate over the entries of the map
      Parameters:
        `consumer` - to apply to each entry in the map

    - #### forEach

          public void forEach(Consumer<V> consumer)

      Iterate over the values in the map
      Parameters:
        `consumer` - to apply to each value in the map

    - #### size

          public int size()

      Return the number of unique entries in the map.
      Returns:
        number of unique entries in the map.

    - #### isEmpty

          public boolean isEmpty()

      Is map empty or not.
      Returns:
        boolean indicating empty map or not

Copyright © 2019. All rights reserved.