Class SymbolTable
- java.lang.Object
-
- org.datanucleus.store.query.compiler.SymbolTable
-
- All Implemented Interfaces:
java.io.Serializable
public class SymbolTable extends java.lang.Object implements java.io.SerializableTable of symbols in a query.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SymbolTableparentSymbolTableSymbolTable for the parent query (when this is a subquery), otherwise null.(package private) SymbolResolverresolverResolver for symbols.private static longserialVersionUID(package private) java.util.Map<java.lang.String,Symbol>symbols
-
Constructor Summary
Constructors Constructor Description SymbolTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddSymbol(Symbol symbol)SymbolTablegetParentSymbolTable()Accessor for the parent symbol table (if any).SymbolgetSymbol(java.lang.String name)Return the Symbol for the specified name if known.SymbolgetSymbolIgnoreCase(java.lang.String name)Return the Symbol for the specified name if known, treating the name as case-insensitive.java.util.Collection<java.lang.String>getSymbolNames()Accessor for the names of the symbols in this table.SymbolResolvergetSymbolResolver()booleanhasSymbol(java.lang.String name)Accessor for whether this symbol table has a particular symbol name.voidremoveSymbol(Symbol symbol)voidsetParentSymbolTable(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.voidsetSymbolResolver(SymbolResolver resolver)java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
parentSymbolTable
SymbolTable parentSymbolTable
SymbolTable for the parent query (when this is a subquery), otherwise null.
-
symbols
java.util.Map<java.lang.String,Symbol> symbols
-
resolver
transient SymbolResolver resolver
Resolver for symbols. Note that this is not serialisable, but is set when compile() is called.
-
-
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 java.util.Collection<java.lang.String> getSymbolNames()
Accessor for the names of the symbols in this table.- Returns:
- Names of the symbols
-
getSymbol
public Symbol getSymbol(java.lang.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(java.lang.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(java.lang.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)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-