public class SymbolTable extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TABLE_SIZE |
static int |
MAX_BUCKET_LENTH |
static int |
MAX_SIZE |
| Constructor and Description |
|---|
SymbolTable() |
SymbolTable(int tableSize) |
| Modifier and Type | Method and Description |
|---|---|
String |
addSymbol(char[] buffer,
int offset,
int len) |
String |
addSymbol(char[] buffer,
int offset,
int len,
int hash)
Adds the specified symbol to the symbol table and returns a reference to the unique symbol.
|
String |
addSymbol(String buffer,
int offset,
int len,
int hash) |
static int |
hash(char[] buffer,
int offset,
int len) |
int |
size() |
public static final int DEFAULT_TABLE_SIZE
public static final int MAX_BUCKET_LENTH
public static final int MAX_SIZE
public String addSymbol(char[] buffer, int offset, int len)
public String addSymbol(char[] buffer, int offset, int len, int hash)
buffer - The buffer containing the new symbol.offset - The offset into the buffer of the new symbol.len - The length of the new symbol in the buffer.public int size()
public static int hash(char[] buffer,
int offset,
int len)
Copyright © 2012–2020 Alibaba Group. All rights reserved.