Class StringTable
- java.lang.Object
-
- software.amazon.smithy.model.loader.StringTable
-
- All Implemented Interfaces:
java.util.function.Function<java.lang.CharSequence,java.lang.String>
public final class StringTable extends java.lang.Object implements java.util.function.Function<java.lang.CharSequence,java.lang.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 Summary
Constructors Constructor Description StringTable()
Create a string table with 2048 entries.StringTable(int sizeBits)
Create a string table with a specific number of entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
apply(java.lang.CharSequence chars)
-
-
-
Constructor Detail
-
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.- Parameters:
sizeBits
- Size of the table based on bit shifting (e.g., 1 -> 2, 2 -> 4, ..., 10 -> 1024, 11 -> 2048).
-
-