DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Cursors.CursorState Class Reference
Inheritance diagram for Deveel.Data.Sql.Cursors.CursorState:

Public Member Functions

void Dispose ()
 

Package Functions

 CursorState (Cursor cursor)
 
void Open (ITable result, SqlExpression[] args)
 
void Close ()
 
Row FetchRowFrom (ITable table, FetchDirection direction, int offset)
 

Properties

Cursor Cursor [get, private set]
 
CursorStatus Status [get, private set]
 
SqlExpression[] OpenArguments [get, private set]
 
ITable Result [get, private set]
 
int CurrentOffset [get, set]
 

Private Member Functions

 ~CursorState ()
 
void Dispose (bool disposing)
 

Detailed Description

Definition at line 23 of file CursorState.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Cursors.CursorState.CursorState ( Cursor  cursor)
inlinepackage

Definition at line 24 of file CursorState.cs.

24  {
25  if (cursor == null)
26  throw new ArgumentNullException("cursor");
27 
28  Cursor = cursor;
29  }
Deveel.Data.Sql.Cursors.CursorState.~CursorState ( )
inlineprivate

Definition at line 31 of file CursorState.cs.

31  {
32  Dispose(false);
33  }

Member Function Documentation

void Deveel.Data.Sql.Cursors.CursorState.Close ( )
inlinepackage

Definition at line 51 of file CursorState.cs.

51  {
52  Status = CursorStatus.Closed;
53  OpenArguments = null;
54  }
void Deveel.Data.Sql.Cursors.CursorState.Dispose ( )
inline

Definition at line 86 of file CursorState.cs.

86  {
87  Dispose(true);
88  GC.SuppressFinalize(this);
89  }
void Deveel.Data.Sql.Cursors.CursorState.Dispose ( bool  disposing)
inlineprivate

Definition at line 91 of file CursorState.cs.

91  {
92  if (disposing) {
93  if (Result != null)
94  Result.Dispose();
95  }
96 
97  Result = null;
98  Cursor = null;
99  Status = CursorStatus.Disposed;
100  }
Row Deveel.Data.Sql.Cursors.CursorState.FetchRowFrom ( ITable  table,
FetchDirection  direction,
int  offset 
)
inlinepackage

Definition at line 56 of file CursorState.cs.

56  {
57  int rowOffset;
58  if (direction == FetchDirection.Next) {
59  rowOffset = CurrentOffset + 1;
60  } else if (direction == FetchDirection.Prior) {
61  rowOffset = CurrentOffset - 1;
62  } else if (direction == FetchDirection.First) {
63  rowOffset = CurrentOffset = 0;
64  } else if (direction == FetchDirection.Last) {
65  rowOffset = table.RowCount;
66  } else if (direction == FetchDirection.Absolute) {
67  rowOffset = offset;
68  } else if (direction == FetchDirection.Relative) {
69  rowOffset = CurrentOffset + offset;
70  } else {
71  // Should never happen
72  throw new InvalidOperationException();
73  }
74 
75  if (rowOffset < 0 || rowOffset >= table.RowCount)
76  throw new IndexOutOfRangeException(
77  String.Format("The fetch offset '{0}' is smaller than zero or greater than the result set ({1}).", rowOffset,
78  table.RowCount));
79 
80  CurrentOffset = rowOffset;
81  Status = CursorStatus.Fetching;
82 
83  return table.GetRow(rowOffset);
84  }
A long string in the system.
int RowCount
Gets the total number of rows in the table.
Definition: ITable.cs:52
void Deveel.Data.Sql.Cursors.CursorState.Open ( ITable  result,
SqlExpression[]  args 
)
inlinepackage

Definition at line 45 of file CursorState.cs.

45  {
46  Status = CursorStatus.Open;
47  Result = result;
48  OpenArguments = args;
49  }

Property Documentation

int Deveel.Data.Sql.Cursors.CursorState.CurrentOffset
getsetprivate

Definition at line 43 of file CursorState.cs.

Cursor Deveel.Data.Sql.Cursors.CursorState.Cursor
getprivate set

Definition at line 35 of file CursorState.cs.

SqlExpression [] Deveel.Data.Sql.Cursors.CursorState.OpenArguments
getprivate set

Definition at line 39 of file CursorState.cs.

ITable Deveel.Data.Sql.Cursors.CursorState.Result
getprivate setpackage

Definition at line 41 of file CursorState.cs.

CursorStatus Deveel.Data.Sql.Cursors.CursorState.Status
getprivate set

Definition at line 37 of file CursorState.cs.


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