| Modifier and Type | Field and Description |
|---|---|
| public static final InternCache | |
| private final Object | lock
As minor optimization let's try to avoid "flush storms", cases where multiple threads might try to concurrently flush the map. |
| private static final int | MAX_ENTRIES
Size to use is somewhat arbitrary, so let's choose something that's neither too small (low hit ratio) nor too large (waste of memory). |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| instance | back to summary |
|---|---|
| public static final InternCache instance | |
| lock | back to summary |
|---|---|
| private final Object lock As minor optimization let's try to avoid "flush storms", cases where multiple threads might try to concurrently flush the map. | |
| MAX_ENTRIES | back to summary |
|---|---|
| private static final int MAX_ENTRIES Size to use is somewhat arbitrary, so let's choose something that's neither too small (low hit ratio) nor too large (waste of memory).
One consideration is possible attack via colliding | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| InternCache | back to summary |
|---|---|
| public InternCache() | |
| InternCache | back to summary |
|---|---|
| public InternCache(int maxSize, float loadFactor, int concurrency) | |
| intern | back to summary |
|---|---|
| public String intern(String input) | |