DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Static Public Attributes | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Objects.SqlArray Class Reference

An object that provides methods for accessing a finite collection of SQL expressions. More...

Inheritance diagram for Deveel.Data.Sql.Objects.SqlArray:
Deveel.Data.Sql.Objects.ISqlObject

Classes

class  Enumerator
 

Public Member Functions

 SqlArray (SqlExpression[] expressions)
 Constructs a new SqlArray on the given array of expressions. More...
 
SqlExpression GetValue (int index)
 Gets the expression at the given index of the array. More...
 
IEnumerator< SqlExpressionGetEnumerator ()
 

Static Public Attributes

static readonly SqlArray Null = new SqlArray(null)
 A SQL array that is equivalent to null. More...
 

Properties

bool IsNull [get, private set]
 
int Length [get]
 Gets the length of the array. More...
 
SqlExpression this[int index] [get]
 Gets the expression at the given index of the array. More...
 
- Properties inherited from Deveel.Data.Sql.Objects.ISqlObject
bool IsNull [get]
 Gets a boolean value indicating if the object is NULL. More...
 

Private Member Functions

int IComparable. CompareTo (object obj)
 
int IComparable< ISqlObject >. CompareTo (ISqlObject other)
 
bool ISqlObject. IsComparableTo (ISqlObject other)
 Checks if the current object is comparable with the given one. More...
 
void AssertNotNull ()
 
IEnumerator IEnumerable. GetEnumerator ()
 

Private Attributes

readonly SqlExpression[] expressions
 

Detailed Description

An object that provides methods for accessing a finite collection of SQL expressions.

Definition at line 28 of file SqlArray.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Objects.SqlArray.SqlArray ( SqlExpression[]  expressions)
inline

Constructs a new SqlArray on the given array of expressions.

Parameters
expressionsThe array of SqlExpression that is the source of this array.

Definition at line 42 of file SqlArray.cs.

42  {
43  if (expressions == null) {
44  this.expressions = null;
45  IsNull = true;
46  } else {
47  this.expressions = new SqlExpression[expressions.Length];
48  Array.Copy(expressions, this.expressions, expressions.Length);
49  }
50  }
readonly SqlExpression[] expressions
Definition: SqlArray.cs:29
Defines the base class for instances that represent SQL expression tree nodes.

Member Function Documentation

void Deveel.Data.Sql.Objects.SqlArray.AssertNotNull ( )
inlineprivate

Definition at line 79 of file SqlArray.cs.

79  {
80  if (IsNull)
81  throw new NullReferenceException("The array is null");
82  }
int IComparable. Deveel.Data.Sql.Objects.SqlArray.CompareTo ( object  obj)
inlineprivate

Definition at line 52 of file SqlArray.cs.

52  {
53  throw new NotSupportedException();
54  }
int IComparable<ISqlObject>. Deveel.Data.Sql.Objects.SqlArray.CompareTo ( ISqlObject  other)
inlineprivate

Definition at line 56 of file SqlArray.cs.

56  {
57  throw new NotSupportedException();
58  }
IEnumerator<SqlExpression> Deveel.Data.Sql.Objects.SqlArray.GetEnumerator ( )
inline

Definition at line 131 of file SqlArray.cs.

131  {
132  AssertNotNull();
133  return new Enumerator(this);
134  }
IEnumerator IEnumerable. Deveel.Data.Sql.Objects.SqlArray.GetEnumerator ( )
inlineprivate

Definition at line 136 of file SqlArray.cs.

136  {
137  return GetEnumerator();
138  }
IEnumerator< SqlExpression > GetEnumerator()
Definition: SqlArray.cs:131
SqlExpression Deveel.Data.Sql.Objects.SqlArray.GetValue ( int  index)
inline

Gets the expression at the given index of the array.

Parameters
indexThe zero-based index in the array at which to get the expression
Returns
Returns an instance of SqlExpression at the index given within the array.
Exceptions
NullReferenceExceptionIf the array is null.
ArgumentOutOfRangeExceptionIf the given index is lower than zero or greater or equal than Length.
See also
GetValue

Definition at line 122 of file SqlArray.cs.

122  {
123  AssertNotNull();
124 
125  if (index < 0 || index >= Length)
126  throw new ArgumentOutOfRangeException("index");
127 
128  return expressions[index];
129  }
int Length
Gets the length of the array.
Definition: SqlArray.cs:68
readonly SqlExpression[] expressions
Definition: SqlArray.cs:29
bool ISqlObject. Deveel.Data.Sql.Objects.SqlArray.IsComparableTo ( ISqlObject  other)
inlineprivate

Checks if the current object is comparable with the given one.

Parameters
otherThe other ISqlObject to compare.
Returns
Returns true if the current object is comparable with the given one, false otherwise.

Implements Deveel.Data.Sql.Objects.ISqlObject.

Definition at line 75 of file SqlArray.cs.

75  {
76  return false;
77  }

Member Data Documentation

readonly SqlExpression [] Deveel.Data.Sql.Objects.SqlArray.expressions
private

Definition at line 29 of file SqlArray.cs.

readonly SqlArray Deveel.Data.Sql.Objects.SqlArray.Null = new SqlArray(null)
static

A SQL array that is equivalent to null.

Definition at line 34 of file SqlArray.cs.

Property Documentation

bool Deveel.Data.Sql.Objects.SqlArray.IsNull
getprivate set

Definition at line 60 of file SqlArray.cs.

int Deveel.Data.Sql.Objects.SqlArray.Length
get

Gets the length of the array.

Exceptions
NullReferenceExceptionIf the array is null.

Definition at line 68 of file SqlArray.cs.

SqlExpression Deveel.Data.Sql.Objects.SqlArray.this[int index]
get

Gets the expression at the given index of the array.

Parameters
indexThe zero-based index in the array at which to get the expression
Returns
Returns an instance of SqlExpression at the index given within the array.
Exceptions
NullReferenceExceptionIf the array is null.
ArgumentOutOfRangeExceptionIf the given index is lower than zero or greater or equal than Length.
See also
GetValue

Definition at line 101 of file SqlArray.cs.


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