Package com.mckoi.database
Class StatementTree
java.lang.Object
com.mckoi.database.StatementTree
- All Implemented Interfaces:
Serializable
,Cloneable
A serializable container class for a parsed query language statement. The
structure of the tree is entirely dependant on the grammar that was used
to create the tree. This object is a convenient form that can be cached and
serialized to be stored.
Think of this as the model of a query after the grammar has been parsed and before it is evaluated.
- Author:
- Tobias Downer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Performs a deep clone of this object, calling 'clone' on any elements that are mutable or shallow copying immutable members.static Object
cloneSingleObject
(Object entry) Clones a single object.boolean
getBoolean
(String entry_name) Gets a boolean entry from the statement tree.Gets the interpreter class that services this tree.int
Gets an integer entry from the statement tree.Gets an object entry from the statement tree.void
prepareAllExpressions
(ExpressionPreparer preparer) For each expression in this StatementTree this method will call the 'prepare' method in each expression.void
putBoolean
(String entry_name, boolean b) Puts a boolean into the statement tree map.void
Puts an integer into the statement tree map.void
Puts a new entry into the statement tree map.toString()
For diagnostic.
-
Constructor Details
-
StatementTree
Constructs the StatementTree.- Parameters:
statement_class
- the name of the class that interpretes this statement (eg. com.mckoi.database.interpret.Select).
-
-
Method Details
-
putObject
Puts a new entry into the statement tree map. -
putBoolean
Puts a boolean into the statement tree map. -
putInt
Puts an integer into the statement tree map. -
getObject
Gets an object entry from the statement tree. -
getBoolean
Gets a boolean entry from the statement tree. -
getInt
Gets an integer entry from the statement tree. -
getClassName
Gets the interpreter class that services this tree. -
prepareAllExpressions
For each expression in this StatementTree this method will call the 'prepare' method in each expression. The prepare method is intended to mutate each expression so that references can be qualified, sub-queries can be resolved, and variable substitutions can be substituted.- Throws:
DatabaseException
-
cloneSingleObject
Clones a single object.- Throws:
CloneNotSupportedException
-
clone
Performs a deep clone of this object, calling 'clone' on any elements that are mutable or shallow copying immutable members.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
toString
For diagnostic.
-