Class StringIntMap

java.lang.Object
org.apache.batik.css.engine.StringIntMap

public class StringIntMap extends Object
A simple hashtable, not synchronized, with fixed load factor. Keys are Strings and values are ints.
Version:
$Id: StringIntMap.java 1733416 2016-03-03 07:07:13Z gadams $
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
    To manage collisions
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The number of entries
    protected StringIntMap.Entry[]
    The underlying array
  • Constructor Summary

    Constructors
    Constructor
    Description
    StringIntMap(int c)
    Creates a new table.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get(String key)
    Gets the value corresponding to the given string.
    void
    put(String key, int value)
    Sets a new value for the given variable
    protected void
    Rehash the table

    Methods inherited from class java.lang.Object

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

    • table

      protected StringIntMap.Entry[] table
      The underlying array
    • count

      protected int count
      The number of entries
  • Constructor Details

    • StringIntMap

      public StringIntMap(int c)
      Creates a new table.
      Parameters:
      c - The capacity of the table.
  • Method Details

    • get

      public int get(String key)
      Gets the value corresponding to the given string.
      Returns:
      the value or -1.
    • put

      public void put(String key, int value)
      Sets a new value for the given variable
    • rehash

      protected void rehash()
      Rehash the table