DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
SearchTextRow.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2014 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 using System;
17 using System.Collections;
18 using System.Runtime.Serialization;
19 
20 namespace Deveel.Data.Text {
24  [Serializable]
25  public sealed class SearchTextRow : ISerializable {
26  #region .ctor
27  public SearchTextRow(int rowIndex) {
28  this.rowIndex = rowIndex;
29  }
30 
31  private SearchTextRow(SerializationInfo info, StreamingContext context) {
32  columns = (Hashtable) info.GetValue("Columns", typeof (Hashtable));
33  rowIndex = info.GetInt32("RowIndex");
34  }
35  #endregion
36 
37  #region Fields
38  private int rowIndex;
39  private Hashtable columns;
40  #endregion
41 
42  #region Properties
43  public int RowIndex {
48  get { return rowIndex; }
49  }
50  #endregion
51 
52  #region Public Methods
53  public void SetValue(string columnName, string value) {
54  if (columnName == null)
55  throw new ArgumentNullException("columnName");
56  if (columnName.Length == 0)
57  throw new ArgumentException();
58 
59  if (columns == null)
60  columns = new Hashtable();
61 
62  columns[columnName] = value;
63  }
64 
65  public string GetValue(string columnName) {
66  if (columnName == null)
67  throw new ArgumentNullException("columnName");
68  if (columnName.Length == 0)
69  throw new ArgumentException();
70 
71  if (columns == null)
72  return null;
73 
74  return columns[columnName] as string;
75  }
76 
77  public void GetObjectData(SerializationInfo info, StreamingContext context) {
78  info.AddValue("Columns", columns, typeof (Hashtable));
79  info.AddValue("RowIndex", rowIndex);
80  }
81  #endregion
82  }
83 }
void SetValue(string columnName, string value)
void GetObjectData(SerializationInfo info, StreamingContext context)
Defines a row stored in the search engine index.
string GetValue(string columnName)
SearchTextRow(SerializationInfo info, StreamingContext context)