Package com.alibaba.fastjson.parser
Class SymbolTable
- java.lang.Object
-
- com.alibaba.fastjson.parser.SymbolTable
-
public class SymbolTable extends Object
- Author:
- wenshao[szujobs@hotmail.com]
-
-
Constructor Summary
Constructors Constructor Description SymbolTable(int tableSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddSymbol(char[] buffer, int offset, int len)StringaddSymbol(char[] buffer, int offset, int len, int hash)Adds the specified symbol to the symbol table and returns a reference to the unique symbol.StringaddSymbol(String buffer, int offset, int len, int hash)StringaddSymbol(String buffer, int offset, int len, int hash, boolean replace)static inthash(char[] buffer, int offset, int len)
-
-
-
Method Detail
-
addSymbol
public String addSymbol(char[] buffer, int offset, int len)
-
addSymbol
public 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. If the symbol already exists, the previous symbol reference is returned instead, in order guarantee that symbol references remain unique.- Parameters:
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.
-
hash
public static int hash(char[] buffer, int offset, int len)
-
-