DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
Deveel.Data.Sql.Tables.FilterTable Class Reference
Inheritance diagram for Deveel.Data.Sql.Tables.FilterTable:
Deveel.Data.Sql.Tables.Table Deveel.Data.Sql.Tables.IQueryTable Deveel.Data.Transactions.ILockable Deveel.Data.Sql.Tables.ITable Deveel.Data.Sql.IDbObject Deveel.Data.Sql.Tables.LimitedTable Deveel.Data.Sql.Tables.ReferenceTable Deveel.Data.Sql.Tables.SubsetColumnTable

Public Member Functions

 FilterTable (ITable parent)
 
override IEnumerator< RowGetEnumerator ()
 
override void Lock ()
 
override void Release ()
 
override DataObject GetValue (long rowNumber, int columnOffset)
 Gets a single cell within the table that is located at the given column offset and row. More...
 
- Public Member Functions inherited from Deveel.Data.Sql.Tables.Table
void Dispose ()
 
ColumnIndex GetIndex (int columnOffset)
 Gets an index for given column that can be used to select values from this table. More...
 

Protected Member Functions

override RawTableInfo GetRawTableInfo (RawTableInfo rootInfo)
 
override ColumnIndex GetIndex (int column, int originalColumn, ITable table)
 
override IEnumerable< int > ResolveRows (int column, IEnumerable< int > rowSet, ITable ancestor)
 
override ObjectName GetResolvedColumnName (int column)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Tables.Table
virtual void Dispose (bool disposing)
 
virtual void OnLockAcquired (Lock @lock)
 
virtual void OnLockReleased (Lock @lock)
 
virtual int IndexOfColumn (ObjectName columnName)
 
int FindColumn (ObjectName columnName)
 

Properties

ITable Parent [get, private set]
 
override IContext Context [get]
 
override TableInfo TableInfo [get]
 
override int RowCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.Table
abstract IContext Context [get]
 
abstract TableInfo TableInfo [get]
 
bool IsLocked [get, private set]
 
object ILockable. RefId [get]
 
int IQueryTable. ColumnCount [get]
 
virtual int ColumnCount [get]
 
abstract int RowCount [get]
 
ObjectName FullName [get]
 
DbObjectType IDbObject. ObjectType [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.IQueryTable
int ColumnCount [get]
 
- Properties inherited from Deveel.Data.Sql.Tables.ITable
IContext Context [get]
 
TableInfo TableInfo [get]
 Gets the metadata information of the table, used to resolve the column sources. More...
 
int RowCount [get]
 Gets the total number of rows in the table. More...
 
- Properties inherited from Deveel.Data.Sql.IDbObject
ObjectName FullName [get]
 Gets the fully qualified name of the object used to resolve it uniquely within the database. More...
 
DbObjectType ObjectType [get]
 Gets the type of database object that the implementation is for More...
 
- Properties inherited from Deveel.Data.Transactions.ILockable
object RefId [get]
 

Private Attributes

ColumnIndex[] columnIndices
 

Detailed Description

Definition at line 23 of file FilterTable.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Tables.FilterTable.FilterTable ( ITable  parent)
inline

Definition at line 26 of file FilterTable.cs.

26  {
27  Parent = parent;
28  }

Member Function Documentation

override IEnumerator<Row> Deveel.Data.Sql.Tables.FilterTable.GetEnumerator ( )
inlinevirtual

Implements Deveel.Data.Sql.Tables.Table.

Reimplemented in Deveel.Data.Sql.Tables.LimitedTable.

Definition at line 32 of file FilterTable.cs.

32  {
33  return Parent.GetEnumerator();
34  }
override ColumnIndex Deveel.Data.Sql.Tables.FilterTable.GetIndex ( int  column,
int  originalColumn,
ITable  table 
)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Tables.Table.

Reimplemented in Deveel.Data.Sql.Tables.SubsetColumnTable.

Definition at line 60 of file FilterTable.cs.

60  {
61  if (columnIndices == null) {
62  columnIndices = new ColumnIndex[Parent.ColumnCount()];
63  }
64 
65  // Is there a local index available?
66  var index = columnIndices[column];
67  if (index == null) {
68  // If we are asking for the index of this table we must
69  // tell the parent we are looking for its index.
70  var t = table;
71  if (table == this)
72  t = Parent;
73 
74  // Index is not cached in this table so ask the parent.
75  index = Parent.GetIndex(column, originalColumn, t);
76  if (table == this)
77  columnIndices[column] = index;
78 
79  } else {
80  // If this has a cached scheme and we are in the correct domain then
81  // return it.
82  if (table == this)
83  return index;
84 
85  // Otherwise we must calculate the subset of the scheme
86  return index.GetSubset(table, originalColumn);
87  }
88 
89  return index;
90  }
virtual ColumnIndex GetSubset(ITable subsetTable, int subsetColumn)
Definition: ColumnIndex.cs:263
ColumnIndex GetIndex(int columnOffset)
Gets an index for given column that can be used to select values from this table. ...
override RawTableInfo Deveel.Data.Sql.Tables.FilterTable.GetRawTableInfo ( RawTableInfo  rootInfo)
inlineprotectedvirtual

Implements Deveel.Data.Sql.Tables.Table.

Definition at line 56 of file FilterTable.cs.

56  {
57  return Parent.GetRawTableInfo(rootInfo);
58  }
override ObjectName Deveel.Data.Sql.Tables.FilterTable.GetResolvedColumnName ( int  column)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Tables.Table.

Reimplemented in Deveel.Data.Sql.Tables.SubsetColumnTable, and Deveel.Data.Sql.Tables.ReferenceTable.

Definition at line 103 of file FilterTable.cs.

103  {
104  return Parent.GetResolvedColumnName(column);
105  }
override DataObject Deveel.Data.Sql.Tables.FilterTable.GetValue ( long  rowNumber,
int  columnOffset 
)
inlinevirtual

Gets a single cell within the table that is located at the given column offset and row.

Parameters
rowNumberThe unique number of the row where the cell is located.
columnOffsetThe zero-based offset of the column of the cell to return.
Returns
Returns an instance of DataObject that is contained in the cell located by the row and column coordinates provided.
Exceptions
ArgumentOutOfRangeExceptionIf the given columnOffset is less than zero or greater or equal than the number of columns defined in the table metadata.
See also
Tables.TableInfo.IndexOfColumn(string)

Implements Deveel.Data.Sql.Tables.Table.

Reimplemented in Deveel.Data.Sql.Tables.SubsetColumnTable, and Deveel.Data.Sql.Tables.LimitedTable.

Definition at line 99 of file FilterTable.cs.

99  {
100  return Parent.GetValue(rowNumber, columnOffset);
101  }
DataObject GetValue(long rowNumber, int columnOffset)
Gets a single cell within the table that is located at the given column offset and row...
override void Deveel.Data.Sql.Tables.FilterTable.Lock ( )
inlinevirtual

Implements Deveel.Data.Sql.Tables.Table.

Definition at line 48 of file FilterTable.cs.

48  {
49  Parent.Lock();
50  }
override void Deveel.Data.Sql.Tables.FilterTable.Release ( )
inlinevirtual

Implements Deveel.Data.Sql.Tables.Table.

Definition at line 52 of file FilterTable.cs.

52  {
53  Parent.Release();
54  }
override IEnumerable<int> Deveel.Data.Sql.Tables.FilterTable.ResolveRows ( int  column,
IEnumerable< int >  rowSet,
ITable  ancestor 
)
inlineprotectedvirtual

Implements Deveel.Data.Sql.Tables.Table.

Reimplemented in Deveel.Data.Sql.Tables.SubsetColumnTable.

Definition at line 92 of file FilterTable.cs.

92  {
93  if (ancestor == this || ancestor == Parent)
94  return rowSet;
95 
96  return Parent.ResolveRows(column, rowSet, ancestor);
97  }

Member Data Documentation

ColumnIndex [] Deveel.Data.Sql.Tables.FilterTable.columnIndices
private

Definition at line 24 of file FilterTable.cs.

Property Documentation

override IContext Deveel.Data.Sql.Tables.FilterTable.Context
get

Definition at line 36 of file FilterTable.cs.

ITable Deveel.Data.Sql.Tables.FilterTable.Parent
getprivate setprotected

Definition at line 30 of file FilterTable.cs.

override int Deveel.Data.Sql.Tables.FilterTable.RowCount
get

Definition at line 44 of file FilterTable.cs.

override TableInfo Deveel.Data.Sql.Tables.FilterTable.TableInfo
get

Definition at line 40 of file FilterTable.cs.


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