Class IntMap

java.lang.Object
com.caucho.hessian.util.IntMap

public class IntMap extends Object
The IntMap provides a simple hashmap from keys to integers. The API is an abbreviation of the HashMap collection API.

The convenience of IntMap is avoiding all the silly wrapping of integers.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Encoding of a null entry.
    static final int[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new IntMap.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the hashmap.
    final int
    get(Object key)
    Puts a new value in the property table with the appropriate flags
    static int
    getBiggestPrime(int value)
     
    protected int
     
    final int
    put(Object key, int value, boolean isReplace)
    Puts a new value in the property table with the appropriate flags
    final int
    Returns the current number of entries in the map.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • NULL

      public static final int NULL
      Encoding of a null entry. Since NULL is equal to Integer.MIN_VALUE, it's impossible to distinguish between the two.
      See Also:
    • PRIMES

      public static final int[] PRIMES
  • Constructor Details

    • IntMap

      public IntMap()
      Create a new IntMap. Default size is 16.
  • Method Details

    • clear

      public void clear()
      Clear the hashmap.
    • size

      public final int size()
      Returns the current number of entries in the map.
    • get

      public final int get(Object key)
      Puts a new value in the property table with the appropriate flags
    • put

      public final int put(Object key, int value, boolean isReplace)
      Puts a new value in the property table with the appropriate flags
    • hashCode

      protected int hashCode(Object value)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBiggestPrime

      public static int getBiggestPrime(int value)