DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Index.InsertSearchIndex Class Reference
Inheritance diagram for Deveel.Data.Index.InsertSearchIndex:
Deveel.Data.Index.CollatedSearchIndex Deveel.Data.Index.ColumnIndex

Classes

class  IndexComparerImpl
 

Public Member Functions

 InsertSearchIndex (ITable table, int columnOffset)
 
 InsertSearchIndex (ITable table, int columnOffset, IEnumerable< int > list)
 
override void Insert (int rowNumber)
 
override void Remove (int rowNumber)
 
override ColumnIndex Copy (ITable table, bool readOnly)
 
- Public Member Functions inherited from Deveel.Data.Index.CollatedSearchIndex
override IEnumerable< int > SelectAll ()
 
override IEnumerable< int > SelectRange (IndexRange[] ranges)
 
- Public Member Functions inherited from Deveel.Data.Index.ColumnIndex
void Dispose ()
 
IIndex< int > Order (IEnumerable< int > rows)
 
IEnumerable< int > SelectRange (IndexRange range)
 
virtual IEnumerable< int > SelectFirst ()
 
IEnumerable< int > SelectNotFirst ()
 
IEnumerable< int > SelectLast ()
 
IEnumerable< int > SelectNotLast ()
 
IEnumerable< int > SelectAllNonNull ()
 
IEnumerable< int > SelectEqual (DataObject ob)
 
IEnumerable< int > SelectNotEqual (DataObject ob)
 
IEnumerable< int > SelectGreater (DataObject ob)
 
IEnumerable< int > SelectLess (DataObject ob)
 
IEnumerable< int > SelectGreaterOrEqual (DataObject ob)
 
IEnumerable< int > SelectLessOrEqual (DataObject ob)
 
IEnumerable< int > SelectBetween (DataObject ob1, DataObject ob2)
 
IEnumerable< int > SelectLike (DataObject value)
 
virtual ColumnIndex GetSubset (ITable subsetTable, int subsetColumn)
 

Protected Member Functions

override IEnumerable< int > AddRange (int start, int end, IEnumerable< int > input)
 
override int SearchFirst (DataObject value)
 
override int SearchLast (DataObject value)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from Deveel.Data.Index.CollatedSearchIndex
 CollatedSearchIndex (ITable table, int columnOffset)
 
- Protected Member Functions inherited from Deveel.Data.Index.ColumnIndex
 ColumnIndex (ITable table, int columnOffset)
 
DataObject GetValue (long row)
 
virtual IEnumerable< int > SearchText (DataObject value)
 
virtual ColumnIndex CreateSubset (ITable table, int column, IEnumerable< int > rows)
 

Properties

override bool IsReadOnly [get]
 
override int Count [get]
 
override string IndexType [get]
 
override DataObject First [get]
 
override DataObject Last [get]
 
bool RecordUid [get, set]
 
- Properties inherited from Deveel.Data.Index.CollatedSearchIndex
virtual int Count [get]
 
virtual DataObject First [get]
 
virtual DataObject Last [get]
 
- Properties inherited from Deveel.Data.Index.ColumnIndex
ITable Table [get, private set]
 
int ColumnOffset [get, private set]
 
virtual bool IsReadOnly [get]
 
virtual bool HandlesTextSearch [get]
 
abstract string IndexType [get]
 

Private Member Functions

 InsertSearchIndex (ITable table, InsertSearchIndex source, bool readOnly)
 

Private Attributes

IIndex< int > list
 
IIndexComparer< int > comparer
 
bool recordUid
 
readonly bool readOnly
 
readonly int readOnlyCount
 

Detailed Description

Definition at line 24 of file InsertSearchIndex.cs.

Constructor & Destructor Documentation

Deveel.Data.Index.InsertSearchIndex.InsertSearchIndex ( ITable  table,
int  columnOffset 
)
inline

Definition at line 33 of file InsertSearchIndex.cs.

34  : base(table, columnOffset) {
35  comparer = new IndexComparerImpl(this);
36  list = new BlockIndex<int>();
37  }
Deveel.Data.Index.InsertSearchIndex.InsertSearchIndex ( ITable  table,
int  columnOffset,
IEnumerable< int >  list 
)
inline

Definition at line 39 of file InsertSearchIndex.cs.

40  : this(table, columnOffset) {
41  if (list != null) {
42  foreach (var item in list) {
43  this.list.Add(item);
44  }
45  }
46  }
Deveel.Data.Index.InsertSearchIndex.InsertSearchIndex ( ITable  table,
InsertSearchIndex  source,
bool  readOnly 
)
inlineprivate

Definition at line 48 of file InsertSearchIndex.cs.

49  : this(table, source.ColumnOffset, source.list) {
50  this.readOnly = readOnly;
51 
52  if (readOnly)
53  readOnlyCount = list.Count;
54 
55  // Do we generate lookup caches?
56  recordUid = source.recordUid;
57 
58  }

Member Function Documentation

override IEnumerable<int> Deveel.Data.Index.InsertSearchIndex.AddRange ( int  start,
int  end,
IEnumerable< int >  input 
)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Index.CollatedSearchIndex.

Definition at line 101 of file InsertSearchIndex.cs.

101  {
102  var result = new List<int>();
103  if (input != null)
104  result.AddRange(input);
105 
106  var en = list.GetEnumerator(start, end);
107  while (en.MoveNext()) {
108  result.Add(en.Current);
109  }
110 
111  return result.ToArray();
112  }
override ColumnIndex Deveel.Data.Index.InsertSearchIndex.Copy ( ITable  table,
bool  readOnly 
)
inlinevirtual

Implements Deveel.Data.Index.ColumnIndex.

Definition at line 114 of file InsertSearchIndex.cs.

114  {
115  // ASSERTION: If readOnly, check the size of the current set is equal to
116  // when the index was created.
117  if (IsReadOnly && readOnlyCount != list.Count)
118  throw new InvalidOperationException("Assert failed: read-only size is different from when created.");
119 
120  // We must create a new InsertSearch object and copy all the state
121  // information from this object to the new one.
122  return new InsertSearchIndex(table, this, readOnly);
123  }
InsertSearchIndex(ITable table, int columnOffset)
override void Deveel.Data.Index.InsertSearchIndex.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Index.CollatedSearchIndex.

Definition at line 133 of file InsertSearchIndex.cs.

133  {
134  list = null;
135  comparer = null;
136  }
override void Deveel.Data.Index.InsertSearchIndex.Insert ( int  rowNumber)
inlinevirtual

Reimplemented from Deveel.Data.Index.CollatedSearchIndex.

Definition at line 82 of file InsertSearchIndex.cs.

82  {
83  if (IsReadOnly)
84  throw new InvalidOperationException("Tried to change an read-only index.");
85 
86  var value = GetValue(rowNumber);
87  list.InsertSort(value, rowNumber, comparer);
88  }
DataObject GetValue(long row)
Definition: ColumnIndex.cs:60
override void Deveel.Data.Index.InsertSearchIndex.Remove ( int  rowNumber)
inlinevirtual

Reimplemented from Deveel.Data.Index.CollatedSearchIndex.

Definition at line 90 of file InsertSearchIndex.cs.

90  {
91  if (IsReadOnly)
92  throw new InvalidOperationException("Tried to change an read-only index.");
93 
94  var value = GetValue(rowNumber);
95  var removed = list.RemoveSort(value, rowNumber, comparer);
96 
97  if (removed != rowNumber)
98  throw new InvalidOperationException(String.Format("Could not remove the requested row ({0})", rowNumber));
99  }
A long string in the system.
DataObject GetValue(long row)
Definition: ColumnIndex.cs:60
override int Deveel.Data.Index.InsertSearchIndex.SearchFirst ( DataObject  value)
inlineprotectedvirtual

Implements Deveel.Data.Index.CollatedSearchIndex.

Definition at line 125 of file InsertSearchIndex.cs.

125  {
126  return list.SearchFirst(value, comparer);
127  }
override int Deveel.Data.Index.InsertSearchIndex.SearchLast ( DataObject  value)
inlineprotectedvirtual

Implements Deveel.Data.Index.CollatedSearchIndex.

Definition at line 129 of file InsertSearchIndex.cs.

129  {
130  return list.SearchLast(value, comparer);
131  }

Member Data Documentation

IIndexComparer<int> Deveel.Data.Index.InsertSearchIndex.comparer
private

Definition at line 26 of file InsertSearchIndex.cs.

IIndex<int> Deveel.Data.Index.InsertSearchIndex.list
private

Definition at line 25 of file InsertSearchIndex.cs.

readonly bool Deveel.Data.Index.InsertSearchIndex.readOnly
private

Definition at line 30 of file InsertSearchIndex.cs.

readonly int Deveel.Data.Index.InsertSearchIndex.readOnlyCount
private

Definition at line 31 of file InsertSearchIndex.cs.

bool Deveel.Data.Index.InsertSearchIndex.recordUid
private

Definition at line 28 of file InsertSearchIndex.cs.

Property Documentation

override int Deveel.Data.Index.InsertSearchIndex.Count
getprotected

Definition at line 64 of file InsertSearchIndex.cs.

override DataObject Deveel.Data.Index.InsertSearchIndex.First
getprotected

Definition at line 72 of file InsertSearchIndex.cs.

override string Deveel.Data.Index.InsertSearchIndex.IndexType
get

Definition at line 68 of file InsertSearchIndex.cs.

override bool Deveel.Data.Index.InsertSearchIndex.IsReadOnly
get

Definition at line 60 of file InsertSearchIndex.cs.

override DataObject Deveel.Data.Index.InsertSearchIndex.Last
getprotected

Definition at line 76 of file InsertSearchIndex.cs.

bool Deveel.Data.Index.InsertSearchIndex.RecordUid
getsetpackage

Definition at line 80 of file InsertSearchIndex.cs.


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