Package com.mckoi.database
Class StatementTree
- java.lang.Object
-
- com.mckoi.database.StatementTree
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public final class StatementTree extends java.lang.Object implements java.io.Serializable, java.lang.CloneableA 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatementTree(java.lang.String statement_class)Constructs the StatementTree.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Performs a deep clone of this object, calling 'clone' on any elements that are mutable or shallow copying immutable members.static java.lang.ObjectcloneSingleObject(java.lang.Object entry)Clones a single object.booleangetBoolean(java.lang.String entry_name)Gets a boolean entry from the statement tree.java.lang.StringgetClassName()Gets the interpreter class that services this tree.intgetInt(java.lang.String entry_name)Gets an integer entry from the statement tree.java.lang.ObjectgetObject(java.lang.String entry_name)Gets an object entry from the statement tree.voidprepareAllExpressions(ExpressionPreparer preparer)For each expression in this StatementTree this method will call the 'prepare' method in each expression.voidputBoolean(java.lang.String entry_name, boolean b)Puts a boolean into the statement tree map.voidputInt(java.lang.String entry_name, int v)Puts an integer into the statement tree map.voidputObject(java.lang.String entry_name, java.lang.Object ob)Puts a new entry into the statement tree map.java.lang.StringtoString()For diagnostic.
-
-
-
Method Detail
-
putObject
public void putObject(java.lang.String entry_name, java.lang.Object ob)Puts a new entry into the statement tree map.
-
putBoolean
public void putBoolean(java.lang.String entry_name, boolean b)Puts a boolean into the statement tree map.
-
putInt
public void putInt(java.lang.String entry_name, int v)Puts an integer into the statement tree map.
-
getObject
public java.lang.Object getObject(java.lang.String entry_name)
Gets an object entry from the statement tree.
-
getBoolean
public boolean getBoolean(java.lang.String entry_name)
Gets a boolean entry from the statement tree.
-
getInt
public int getInt(java.lang.String entry_name)
Gets an integer entry from the statement tree.
-
getClassName
public java.lang.String getClassName()
Gets the interpreter class that services this tree.
-
prepareAllExpressions
public void prepareAllExpressions(ExpressionPreparer preparer) throws DatabaseException
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
public static java.lang.Object cloneSingleObject(java.lang.Object entry) throws java.lang.CloneNotSupportedExceptionClones a single object.- Throws:
java.lang.CloneNotSupportedException
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionPerforms a deep clone of this object, calling 'clone' on any elements that are mutable or shallow copying immutable members.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
For diagnostic.- Overrides:
toStringin classjava.lang.Object
-
-