public class SymbolTable extends Object
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_TABLE_SIZE |
static int |
MAX_BUCKET_LENTH |
static int |
MAX_SIZE |
构造器和说明 |
---|
SymbolTable() |
SymbolTable(int tableSize) |
限定符和类型 | 方法和说明 |
---|---|
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–2016 Alibaba Group. All rights reserved.