Class SymbolTable
- java.lang.Object
-
- org.datanucleus.store.query.compiler.SymbolTable
-
- All Implemented Interfaces:
Serializable
public class SymbolTable extends Object implements Serializable
Table of symbols in a query.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SymbolTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addSymbol(Symbol symbol)
SymbolTable
getParentSymbolTable()
Accessor for the parent symbol table (if any).Symbol
getSymbol(String name)
Return the Symbol for the specified name if known.Symbol
getSymbolIgnoreCase(String name)
Return the Symbol for the specified name if known, treating the name as case-insensitive.Collection<String>
getSymbolNames()
Accessor for the names of the symbols in this table.SymbolResolver
getSymbolResolver()
boolean
hasSymbol(String name)
Accessor for whether this symbol table has a particular symbol name.void
removeSymbol(Symbol symbol)
void
setParentSymbolTable(SymbolTable tbl)
Set the symbol table for any parent query, so that if this query refers to an expression from the parent query then it is resolvable.void
setSymbolResolver(SymbolResolver resolver)
String
toString()
-
-
-
Method Detail
-
setSymbolResolver
public void setSymbolResolver(SymbolResolver resolver)
-
getSymbolResolver
public SymbolResolver getSymbolResolver()
-
setParentSymbolTable
public void setParentSymbolTable(SymbolTable tbl)
Set the symbol table for any parent query, so that if this query refers to an expression from the parent query then it is resolvable.- Parameters:
tbl
- The parent symbol table
-
getParentSymbolTable
public SymbolTable getParentSymbolTable()
Accessor for the parent symbol table (if any).- Returns:
- The parent symbol table
-
getSymbolNames
public Collection<String> getSymbolNames()
Accessor for the names of the symbols in this table.- Returns:
- Names of the symbols
-
getSymbol
public Symbol getSymbol(String name)
Return the Symbol for the specified name if known. If there is a parent symbol table then looks up in that after if not found here (unless the name is "this").- Parameters:
name
- The name to look up- Returns:
- The symbol for this name
-
getSymbolIgnoreCase
public Symbol getSymbolIgnoreCase(String name)
Return the Symbol for the specified name if known, treating the name as case-insensitive. If there is a parent symbol table then looks up in that after if not found here (unless the name is "this").- Parameters:
name
- The name to look up- Returns:
- The symbol for this name
-
hasSymbol
public boolean hasSymbol(String name)
Accessor for whether this symbol table has a particular symbol name. Does not make any use of parent symbol table(s).- Parameters:
name
- The name of the symbol we require- Returns:
- Whether it is present here
-
addSymbol
public int addSymbol(Symbol symbol)
-
removeSymbol
public void removeSymbol(Symbol symbol)
-
-