PNames, specifically, instances of
(PNameC).
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | CharBasedPNameTable.Bucket
This class is a symbol table entry. |
| Modifier and Type | Field and Description |
|---|---|
| protected CharBasedPNameTable. | _buckets
Overflow buckets; if primary doesn't match, lookup is done from here. |
| protected boolean | _dirty
Flag that indicates if any changes have been made to the data; used to both determine if bucket array needs to be copied when (first) change is made, and potentially if updated bucket list is to be resync'ed back to master instance. |
| protected int | _indexMask
Mask used to get index from hash values; equal to
|
| protected int | _size
Current size (number of entries); needed to know if and when rehash. |
| protected int | _sizeThreshold
Limit that indicates maximum size this instance can hold before it needs to be expanded and rehashed. |
| protected PNameC[] | _symbols
Primary matching symbols; it's expected most match occur from here. |
| protected static final float | |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| public | CharBasedPNameTable(int
Minimum initial size for bucket array; internally
will always use a power of two equal to or bigger than this value. initialSize)Main method for constructing a master symbol table instance; will be called by other public constructors. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PNameC | |
| private void | copyArrays()
Method called when copy-on-write is needed; generally when first change is made to a derived symbol table. |
| public PNameC | |
| public boolean | maybeDirty()
Implements abstract com. |
| public synchronized void | mergeFromChild(CharBasedPNameTable child)
Method that allows contents of child table to potentially be "merged in" with contents of this symbol table. |
| private void | rehash()
Method called when size (number of entries) of symbol table grows so big that load factor is exceeded. |
| public int |
| _buckets | back to summary |
|---|---|
| protected CharBasedPNameTable. Overflow buckets; if primary doesn't match, lookup is done from here. Note Number of buckets is half of number of symbol entries, on assumption there's less need for buckets. | |
| _dirty | back to summary |
|---|---|
| protected boolean _dirty Flag that indicates if any changes have been made to the data; used to both determine if bucket array needs to be copied when (first) change is made, and potentially if updated bucket list is to be resync'ed back to master instance. | |
| _indexMask | back to summary |
|---|---|
| protected int _indexMask Mask used to get index from hash values; equal to
| |
| _size | back to summary |
|---|---|
| protected int _size Current size (number of entries); needed to know if and when rehash. | |
| _sizeThreshold | back to summary |
|---|---|
| protected int _sizeThreshold Limit that indicates maximum size this instance can hold before it needs to be expanded and rehashed. Calculated using fill factor passed in to constructor. | |
| _symbols | back to summary |
|---|---|
| protected PNameC[] _symbols Primary matching symbols; it's expected most match occur from here. | |
| DEFAULT_FILL_FACTOR | back to summary |
|---|---|
| protected static final float DEFAULT_FILL_FACTOR | |
| MIN_HASH_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_HASH_SIZE | |
| CharBasedPNameTable | back to summary |
|---|---|
| public CharBasedPNameTable(int initialSize) Main method for constructing a master symbol table instance; will be called by other public constructors.
| |
| CharBasedPNameTable | back to summary |
|---|---|
| pack-priv CharBasedPNameTable(CharBasedPNameTable parent) | |
| addSymbol | back to summary |
|---|---|
| public PNameC addSymbol(char[] buffer, int start, int len, int hash) | |
| copyArrays | back to summary |
|---|---|
| private void copyArrays() Method called when copy-on-write is needed; generally when first change is made to a derived symbol table. | |
| findSymbol | back to summary |
|---|---|
| public PNameC findSymbol(char[] buffer, int start, int len, int hash) | |
| maybeDirty | back to summary |
|---|---|
| public boolean maybeDirty() Implements abstract com. Doc from com. Method called to check to quickly see if a child symbol table may have gotten additional entries. Used for checking to see if a child table should be merged into shared table.
| |
| mergeFromChild | back to summary |
|---|---|
| public synchronized void mergeFromChild(CharBasedPNameTable child) Method that allows contents of child table to potentially be "merged in" with contents of this symbol table. Note that caller has to make sure symbol table passed in is really a child or sibling of this symbol table. | |
| rehash | back to summary |
|---|---|
| private void rehash() Method called when size (number of entries) of symbol table grows so big that load factor is exceeded. Since size has to remain power of two, arrays will then always be doubled. Main work is really redistributing old entries into new String/Bucket entries. | |
| size | back to summary |
|---|---|
| public int size() Implements abstract com.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final CharBasedPNameTable. | |
| private final PNameC |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public PNameC | |
| public CharBasedPNameTable. | |
| public PNameC |
| mNext | back to summary |
|---|---|
| private final CharBasedPNameTable. | |
| mSymbol | back to summary |
|---|---|
| private final PNameC mSymbol | |
| Bucket | back to summary |
|---|---|
| public Bucket(PNameC symbol, CharBasedPNameTable. | |
| find | back to summary |
|---|---|
| public PNameC find(char[] buf, int start, int len, int hash) | |
| getNext | back to summary |
|---|---|
| public CharBasedPNameTable. | |
| getSymbol | back to summary |
|---|---|
| public PNameC getSymbol() | |