DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator Class Reference
Inheritance diagram for Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator:
Deveel.Data.Sql.Expressions.SqlExpressionVisitor

Public Member Functions

 RangeSetCalculator (IRequest context, ColumnInfo field, IndexRangeSet rangeSet)
 
override SqlExpression VisitBinary (SqlBinaryExpression binaryEpression)
 
IndexRangeSet Calculate (SqlExpression expression)
 
- Public Member Functions inherited from Deveel.Data.Sql.Expressions.SqlExpressionVisitor
virtual SqlExpression Visit (SqlExpression expression)
 Visits a given SQL expression. More...
 
virtual SqlExpression[] VisitExpressionList (SqlExpression[] list)
 Visits a list of expressions given. More...
 
virtual SqlExpression VisitFunctionCall (SqlFunctionCallExpression expression)
 Visits the expression that calls the function defined. More...
 
virtual SqlExpression VisitUnary (SqlUnaryExpression unary)
 
virtual SqlExpression VisitCast (SqlCastExpression castExpression)
 
virtual SqlExpression VisitReference (SqlReferenceExpression reference)
 
virtual SqlExpression VisitVariableReference (SqlVariableReferenceExpression reference)
 
virtual SqlExpression VisitAssign (SqlAssignExpression assign)
 
virtual SqlExpression VisitConstant (SqlConstantExpression constant)
 
virtual SqlExpression VisitConditional (SqlConditionalExpression conditional)
 
virtual SqlExpression VisitTuple (SqlTupleExpression expression)
 
virtual SqlExpression VisitQuery (SqlQueryExpression query)
 

Private Member Functions

IndexRangeSet UpdateRange (SqlExpression expression)
 
IndexRangeSet CalcExpression (SqlExpression expression)
 

Private Attributes

IndexRangeSet rangeSet
 
readonly IRequest context
 
readonly ColumnInfo field
 

Detailed Description

Definition at line 149 of file RangeSelectNode.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.RangeSetCalculator ( IRequest  context,
ColumnInfo  field,
IndexRangeSet  rangeSet 
)
inline

Definition at line 154 of file RangeSelectNode.cs.

154  {
155  this.context = context;
156  this.field = field;
157  this.rangeSet = rangeSet;
158  }

Member Function Documentation

IndexRangeSet Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.CalcExpression ( SqlExpression  expression)
inlineprivate

Definition at line 165 of file RangeSelectNode.cs.

165  {
166  var indexRangeSet = new IndexRangeSet();
167  var calculator = new RangeSetCalculator(context, field, indexRangeSet);
168  return calculator.Calculate(expression);
169  }
RangeSetCalculator(IRequest context, ColumnInfo field, IndexRangeSet rangeSet)
IndexRangeSet Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.Calculate ( SqlExpression  expression)
inline

Definition at line 188 of file RangeSelectNode.cs.

188  {
189  Visit(expression);
190  return rangeSet;
191  }
virtual SqlExpression Visit(SqlExpression expression)
Visits a given SQL expression.
IndexRangeSet Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.UpdateRange ( SqlExpression  expression)
inlineprivate

Definition at line 160 of file RangeSelectNode.cs.

160  {
161  var updater = new RangeSetUpdater(context, field, rangeSet);
162  return updater.Update(expression);
163  }
override SqlExpression Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.VisitBinary ( SqlBinaryExpression  binaryEpression)
inlinevirtual

Parameters
binaryEpression
Returns

Reimplemented from Deveel.Data.Sql.Expressions.SqlExpressionVisitor.

Definition at line 171 of file RangeSelectNode.cs.

171  {
172  if (binaryEpression.ExpressionType == SqlExpressionType.And) {
173  rangeSet = UpdateRange(binaryEpression.Left);
174  rangeSet = UpdateRange(binaryEpression.Right);
175  } else if (binaryEpression.ExpressionType == SqlExpressionType.Or) {
176  var left = CalcExpression(binaryEpression.Left);
177  var right = CalcExpression(binaryEpression.Right);
178 
179  rangeSet = rangeSet.Union(left);
180  rangeSet = rangeSet.Union(right);
181  } else {
182  rangeSet = UpdateRange(binaryEpression);
183  }
184 
185  return base.VisitBinary(binaryEpression);
186  }
SqlExpressionType
All the possible type of SqlExpression supported
IndexRangeSet CalcExpression(SqlExpression expression)
IndexRangeSet UpdateRange(SqlExpression expression)
IndexRangeSet Union(IndexRangeSet unionTo)
Unions the current range set with the given range set.

Member Data Documentation

readonly IRequest Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.context
private

Definition at line 151 of file RangeSelectNode.cs.

readonly ColumnInfo Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.field
private

Definition at line 152 of file RangeSelectNode.cs.

IndexRangeSet Deveel.Data.Sql.Query.RangeSelectNode.RangeSetCalculator.rangeSet
private

Definition at line 150 of file RangeSelectNode.cs.


The documentation for this class was generated from the following file: