DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
CellId.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System;
18 using System.Diagnostics;
19 
20 using Deveel.Data.Sql.Tables;
21 
22 namespace Deveel.Data.Sql {
23  [DebuggerDisplay("ToString()")]
24  public struct CellId : IEquatable<CellId> {
25  public CellId(RowId rowId, int columnOffset)
26  :this() {
27  RowId = rowId;
28  ColumnOffset = columnOffset;
29  }
30 
31  public RowId RowId { get; private set; }
32 
33  public int ColumnOffset { get; private set; }
34 
35  public bool Equals(CellId other) {
36  return RowId.Equals(other.RowId) &&
37  ColumnOffset.Equals(other.ColumnOffset);
38  }
39 
40  public override bool Equals(object obj) {
41  if (!(obj is CellId))
42  return false;
43 
44  return Equals((CellId)obj);
45  }
46 
47  public override int GetHashCode() {
48  return base.GetHashCode();
49  }
50 
51  public override string ToString() {
52  return String.Format("{0}({1})", RowId, ColumnOffset);
53  }
54  }
55 }
override string ToString()
Definition: CellId.cs:51
bool Equals(RowId other)
Definition: RowId.cs:66
override int GetHashCode()
Definition: CellId.cs:47
CellId(RowId rowId, int columnOffset)
Definition: CellId.cs:25
override bool Equals(object obj)
Definition: CellId.cs:40
Defines the value of a ROWID object, that is a unique reference within a database system to a single ...
Definition: RowId.cs:24
bool Equals(CellId other)
Definition: CellId.cs:35