com.sun.tools.javac.util
Class UnsharedNameTable

java.lang.Object
  extended by com.sun.tools.javac.util.Name.Table
      extended by com.sun.tools.javac.util.UnsharedNameTable

public class UnsharedNameTable
extends Name.Table

Implementation of Name.Table that stores names in individual arrays using weak references. It is recommended for use when a single shared byte array is unsuitable.

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 UnsharedNameTable.HashEntry
           
(package private) static class UnsharedNameTable.NameImpl
           
 
Field Summary
private  UnsharedNameTable.HashEntry[] hashes
          The hash table for names.
private  int hashMask
          The mask to be used for hashing
 int index
          Index counter for names in this table.
 
Fields inherited from class com.sun.tools.javac.util.Name.Table
names
 
Constructor Summary
UnsharedNameTable(Names names)
           
UnsharedNameTable(Names names, int hashSize)
          Allocator
 
Method Summary
static Name.Table create(Names names)
           
 void dispose()
          Release any resources used by this table.
 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

hashes

private UnsharedNameTable.HashEntry[] hashes
The hash table for names.


hashMask

private int hashMask
The mask to be used for hashing


index

public int index
Index counter for names in this table.

Constructor Detail

UnsharedNameTable

public UnsharedNameTable(Names names,
                         int hashSize)
Allocator

Parameters:
names - The main name table
hashSize - the (constant) size to be used for the hash table needs to be a power of two.

UnsharedNameTable

public UnsharedNameTable(Names names)
Method Detail

create

public static Name.Table create(Names names)

fromChars

public Name fromChars(char[] cs,
                      int start,
                      int len)
Description copied from class: Name.Table
Get the name from the characters in cs[start..start+len-1].

Specified by:
fromChars in class Name.Table

fromUtf

public Name fromUtf(byte[] cs,
                    int start,
                    int len)
Description copied from class: Name.Table
get the name for the bytes in cs[start..start+len-1]. Assume that bytes are in utf8 format.

Specified by:
fromUtf in class Name.Table

dispose

public void dispose()
Description copied from class: Name.Table
Release any resources used by this table.

Specified by:
dispose in class Name.Table