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

Defines the value of a ROWID object, that is a unique reference within a database system to a single row. More...

Inheritance diagram for Deveel.Data.Sql.Tables.RowId:

Public Member Functions

 RowId (int tableId, int rowNumber)
 Constructs the object with the references to the given table unique ID and the number of the row within the given table. More...
 
bool Equals (RowId other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static bool TryParse (string s, out RowId value)
 Attempts to parse the input string given into a valid instance of RowId. More...
 
static RowId Parse (string s)
 Parses the given input string into an instance of RowId. More...
 

Static Public Attributes

static readonly RowId Null = new RowId(true)
 Gets a NULL instance of RowId. More...
 

Properties

int TableId [get, private set]
 Gets the unique identifier of the table the row is contained. More...
 
int RowNumber [get, private set]
 Gets the number of the column within the table referenced. More...
 
bool IsNull [get, private set]
 Gets a boolean value indicating if the object equivales to a NULL. More...
 

Private Member Functions

 RowId (bool isNull)
 

Detailed Description

Defines the value of a ROWID object, that is a unique reference within a database system to a single row.

Definition at line 24 of file RowId.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Tables.RowId.RowId ( int  tableId,
int  rowNumber 
)
inline

Constructs the object with the references to the given table unique ID and the number of the row within the given table.

Parameters
tableIdThe table unique identifier with the database system.
rowNumberThe number of the row within the table. This value is always unique, also after the row is removed.

Definition at line 39 of file RowId.cs.

40  : this(false) {
41  RowNumber = rowNumber;
42  TableId = tableId;
43  }
int RowNumber
Gets the number of the column within the table referenced.
Definition: RowId.cs:58
int TableId
Gets the unique identifier of the table the row is contained.
Definition: RowId.cs:53
Deveel.Data.Sql.Tables.RowId.RowId ( bool  isNull)
inlineprivate

Definition at line 45 of file RowId.cs.

46  : this() {
47  IsNull = isNull;
48  }
bool IsNull
Gets a boolean value indicating if the object equivales to a NULL.
Definition: RowId.cs:64

Member Function Documentation

bool Deveel.Data.Sql.Tables.RowId.Equals ( RowId  other)
inline

Definition at line 66 of file RowId.cs.

66  {
67  if (IsNull && other.IsNull)
68  return true;
69 
70  return TableId.Equals(other.TableId) &&
71  RowNumber.Equals(other.RowNumber);
72  }
bool IsNull
Gets a boolean value indicating if the object equivales to a NULL.
Definition: RowId.cs:64
int RowNumber
Gets the number of the column within the table referenced.
Definition: RowId.cs:58
int TableId
Gets the unique identifier of the table the row is contained.
Definition: RowId.cs:53
override bool Deveel.Data.Sql.Tables.RowId.Equals ( object  obj)
inline

Definition at line 74 of file RowId.cs.

74  {
75  if (!(obj is RowId))
76  return false;
77 
78  return Equals((RowId) obj);
79  }
bool Equals(RowId other)
Definition: RowId.cs:66
RowId(int tableId, int rowNumber)
Constructs the object with the references to the given table unique ID and the number of the row with...
Definition: RowId.cs:39
override int Deveel.Data.Sql.Tables.RowId.GetHashCode ( )
inline

Definition at line 81 of file RowId.cs.

81  {
82  if (IsNull)
83  return 0;
84 
85  return unchecked (TableId.GetHashCode() ^ RowNumber.GetHashCode());
86  }
bool IsNull
Gets a boolean value indicating if the object equivales to a NULL.
Definition: RowId.cs:64
int RowNumber
Gets the number of the column within the table referenced.
Definition: RowId.cs:58
int TableId
Gets the unique identifier of the table the row is contained.
Definition: RowId.cs:53
static RowId Deveel.Data.Sql.Tables.RowId.Parse ( string  s)
inlinestatic

Parses the given input string into an instance of RowId.

Parameters
sThe input string to parse.
Returns
Returns a new instance of RowId as a result of the parse of the input string.
Exceptions
FormatExceptionIf the format of the input string is invalid.

Definition at line 138 of file RowId.cs.

138  {
139  RowId rowId;
140  if (!TryParse(s, out rowId))
141  throw new FormatException("Unable to parse the given string into a valid ROWID.");
142 
143  return rowId;
144  }
RowId(int tableId, int rowNumber)
Constructs the object with the references to the given table unique ID and the number of the row with...
Definition: RowId.cs:39
static bool TryParse(string s, out RowId value)
Attempts to parse the input string given into a valid instance of RowId.
Definition: RowId.cs:103
override string Deveel.Data.Sql.Tables.RowId.ToString ( )
inline

Definition at line 88 of file RowId.cs.

88  {
89  return String.Format("{0}-{1}", TableId, RowNumber);
90  }
A long string in the system.
int RowNumber
Gets the number of the column within the table referenced.
Definition: RowId.cs:58
int TableId
Gets the unique identifier of the table the row is contained.
Definition: RowId.cs:53
static bool Deveel.Data.Sql.Tables.RowId.TryParse ( string  s,
out RowId  value 
)
inlinestatic

Attempts to parse the input string given into a valid instance of RowId.

Parameters
sThe input string to parse.
valueThe out value from the parse.
Returns
Returns true if the string was succesfully parsed into a RowId, otherwise false.
See also
ToString

Definition at line 103 of file RowId.cs.

103  {
104  value = Null;
105 
106  if (String.IsNullOrEmpty(s))
107  return false;
108 
109  var index = s.IndexOf("-", StringComparison.Ordinal);
110  if (index == -1)
111  return false;
112 
113  var s1 = s.Substring(0, index);
114  var s2 = s.Substring(index + 1);
115 
116  int v1;
117  int v2;
118  if (!Int32.TryParse(s1, out v1))
119  return false;
120  if (!Int32.TryParse(s2, out v2))
121  return false;
122 
123  value = new RowId(v1, v2);
124  return true;
125  }
A long string in the system.
RowId(int tableId, int rowNumber)
Constructs the object with the references to the given table unique ID and the number of the row with...
Definition: RowId.cs:39
static readonly RowId Null
Gets a NULL instance of RowId.
Definition: RowId.cs:28

Member Data Documentation

readonly RowId Deveel.Data.Sql.Tables.RowId.Null = new RowId(true)
static

Gets a NULL instance of RowId.

Definition at line 28 of file RowId.cs.

Property Documentation

bool Deveel.Data.Sql.Tables.RowId.IsNull
getprivate set

Gets a boolean value indicating if the object equivales to a NULL.

Definition at line 64 of file RowId.cs.

int Deveel.Data.Sql.Tables.RowId.RowNumber
getprivate set

Gets the number of the column within the table referenced.

Definition at line 58 of file RowId.cs.

int Deveel.Data.Sql.Tables.RowId.TableId
getprivate set

Gets the unique identifier of the table the row is contained.

Definition at line 53 of file RowId.cs.


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