Package gnu.text
Class NamedCharTable
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- gnu.kawa.util.AbstractHashTable<HashNode<K,V>,K,V>
-
- gnu.kawa.util.GeneralHashTable<String,String>
-
- gnu.text.NamedCharTable
-
public class NamedCharTable extends GeneralHashTable<String,String>
A table to manage standard character names. This is conceptually aHashMap<String,String>
, except that the value strings are allocated lazily when the key is first requested. (Not sure if this is worth a separate class, but the code is simple, it should make startup faster, and save having to intern over 2200 value strings.)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
-
Fields inherited from class gnu.kawa.util.AbstractHashTable
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
-
-
Constructor Summary
Constructors Constructor Description NamedCharTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
appendTo(String key, Appendable out)
protected HashNode<String,String>
makeEntry(String key, int hash, String value)
Allocate a new node in the hash table.void
put(String name, int char1)
void
put(String name, int char1, int char2)
-
Methods inherited from class gnu.kawa.util.GeneralHashTable
allocEntries, getEntryHashCode, getEntryNext, getNode, setEntryNext
-
Methods inherited from class gnu.kawa.util.AbstractHashTable
clear, entrySet, get, get, getOrDefault, hash, hashToIndex, matches, matches, put, put, rehash, remove, size
-
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
makeEntry
protected HashNode<String,String> makeEntry(String key, int hash, String value)
Description copied from class:GeneralHashTable
Allocate a new node in the hash table.- Overrides:
makeEntry
in classGeneralHashTable<String,String>
-
appendTo
public boolean appendTo(String key, Appendable out)
-
put
public void put(String name, int char1)
-
put
public void put(String name, int char1, int char2)
-
-