Class StringTable

All Implemented Interfaces:

public final class StringTable extends Object implements Function<CharSequence,String>
This is a simple, not thread-safe, caching string table that converts CharSequence to String objects.

The implementation uses an FNV-1a hash, and collisions simply overwrite the previously cached value.

  • Constructor Details

    • StringTable

      public StringTable()
      Create a string table with 2048 entries.
    • StringTable

      public StringTable(int sizeBits)
      Create a string table with a specific number of entries.
      sizeBits - Size of the table based on bit shifting (e.g., 1 -> 2, 2 -> 4, ..., 10 -> 1024, 11 -> 2048).
  • Method Details