|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.util.Name.Table
com.sun.tools.javac.util.SharedNameTable
public class SharedNameTable
Implementation of Name.Table that stores all names in a single shared byte array, expanding it as needed. This avoids the overhead incurred by using an array of bytes for each name.
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Nested Class Summary | |
|---|---|
(package private) static class |
SharedNameTable.NameImpl
|
| Field Summary | |
|---|---|
byte[] |
bytes
The shared byte array holding all encountered names. |
private static List<java.lang.ref.SoftReference<SharedNameTable>> |
freelist
|
private SharedNameTable.NameImpl[] |
hashes
The hash table for names. |
private int |
hashMask
The mask to be used for hashing |
private int |
nc
The number of filled bytes in `names'. |
| Fields inherited from class com.sun.tools.javac.util.Name.Table |
|---|
names |
| Constructor Summary | |
|---|---|
SharedNameTable(Names names)
|
|
SharedNameTable(Names names,
int hashSize,
int nameSize)
Allocator |
|
| Method Summary | |
|---|---|
static SharedNameTable |
create(Names names)
|
void |
dispose()
Release any resources used by this table. |
private static void |
dispose(SharedNameTable t)
|
Name |
fromChars(char[] cs,
int start,
int len)
Get the name from the characters in cs[start..start+len-1]. |
Name |
fromUtf(byte[] cs,
int start,
int len)
get the name for the bytes in cs[start..start+len-1]. |
| Methods inherited from class com.sun.tools.javac.util.Name.Table |
|---|
equals, fromString, fromUtf, hashValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static List<java.lang.ref.SoftReference<SharedNameTable>> freelist
private SharedNameTable.NameImpl[] hashes
public byte[] bytes
private int hashMask
private int nc
| Constructor Detail |
|---|
public SharedNameTable(Names names,
int hashSize,
int nameSize)
names - The main name tablehashSize - the (constant) size to be used for the hash table
needs to be a power of two.nameSize - the initial size of the name table.public SharedNameTable(Names names)
| Method Detail |
|---|
public static SharedNameTable create(Names names)
private static void dispose(SharedNameTable t)
public Name fromChars(char[] cs,
int start,
int len)
Name.Table
fromChars in class Name.Table
public Name fromUtf(byte[] cs,
int start,
int len)
Name.Table
fromUtf in class Name.Tablepublic void dispose()
Name.Table
dispose in class Name.Table
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||