note
VeloxDB is still in beta and APIs are subject to change. We are in the process of completing the documentation, so some sections may be incomplete or empty at this time.
Class SortedIndexReader<T, TKey1, TKey2>
Reader for sorted index with two properties as a key. Use this class to lookup a DatabaseObject using sorted index.
Inheritance
Namespace: VeloxDB.ObjectInterface
Assembly: vlxdb.dll
Syntax
public sealed class SortedIndexReader<T, TKey1, TKey2> : Object where T : DatabaseObject
Type Parameters
Name | Description |
---|---|
T | Type of DatabaseObject being looked up. |
TKey1 | Type of the first key property. |
TKey2 | Type of the second key property. |
Methods
GetAfter(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition (key1, key2) > (keyProperty1, keyProperty2). Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetAfter(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetAfter(TKey1, ScanDirection)
Searches the sorted index using the condition key1 >= keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetAfter(TKey1 key1, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetAfterOrEqual(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition (key1, key2) >= (keyProperty1, keyProperty2). Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetAfterOrEqual(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetAfterOrEqual(TKey1, ScanDirection)
Searches the sorted index using the condition key1 >= keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetAfterOrEqual(TKey1 key1, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetBefore(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition (key1, key2) < (keyProperty1, keyProperty2). Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetBefore(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetBefore(TKey1, ScanDirection)
Searches the sorted index using the condition key1 < keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetBefore(TKey1 key1, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetBeforeOrEqual(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition (key1, key2) <= (keyProperty1, keyProperty2). Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetBeforeOrEqual(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetBeforeOrEqual(TKey1, ScanDirection)
Searches the sorted index using the condition key1 <= keyProperty1. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetBeforeOrEqual(TKey1 key1, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetEntireRange(ScanDirection)
Returns all the objects in the index.
Declaration
public IEnumerable<T> GetEntireRange(ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetEqual(TKey1, TKey2)
Searches the sorted index using the condition key1 = keyProperty1 AND key2 == keyProperty2. This method returns at most a single object with a given key and is ideal for querying unique indexes.
Declaration
public T GetEqual(TKey1 key1, TKey2 key2)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
Returns
Type | Description |
---|---|
T | An object with a given key, if one exists, null otherwise. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetEqual(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition key1 = keyProperty1 AND key2 = keyProperty2.
Declaration
public IEnumerable<T> GetEqual(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetEqual(TKey1, ScanDirection)
Searches the sorted index using the condition key1 = keyProperty1.
Declaration
public IEnumerable<T> GetEqual(TKey1 key1, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetPartialAfter(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition key1 == keyProperty1 AND key2 > keyProperty2. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetPartialAfter(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetPartialAfterOrEqual(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition key1 == keyProperty1 AND key2 >= keyProperty2. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetPartialAfterOrEqual(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetPartialBefore(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition key1 = keyProperty1 AND key2 < keyProperty2. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetPartialBefore(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetPartialBeforeOrEqual(TKey1, TKey2, ScanDirection)
Searches the sorted index using the condition key1 = keyProperty1 AND key2 <= keyProperty2. Keep in mind that signs < and > are relative to the sorting order of the property in the index, meaning before and after in the sort order.
Declaration
public IEnumerable<T> GetPartialBeforeOrEqual(TKey1 key1, TKey2 key2, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | key1 | The value of the first key property. |
TKey2 | key2 | The value of the second key property. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetRange(TKey1, TKey2, Boolean, TKey1, TKey2, Boolean, ScanDirection)
Returns all the objects in the index that belong to the given interval.
Declaration
public IEnumerable<T> GetRange(TKey1 startKey1, TKey2 startKey2, bool isStartOpen, TKey1 endKey1, TKey2 endKey2, bool isEndOpen, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | startKey1 | The value of the first key property for the range start. |
TKey2 | startKey2 | The value of the second key property for the range start. |
System.Boolean | isStartOpen | Indicates whether the start side of the interval is open or closed. |
TKey1 | endKey1 | The value of the first key property for the range end. |
TKey2 | endKey2 | The value of the second key property for the range end. |
System.Boolean | isEndOpen | Indicates whether the end side of the interval is open or closed. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |
GetRange(TKey1, Boolean, TKey1, Boolean, ScanDirection)
Returns all the objects in the index that belong to the given interval.
Declaration
public IEnumerable<T> GetRange(TKey1 startKey1, bool isStartOpen, TKey1 endKey1, bool isEndOpen, ScanDirection scanDirection)
Parameters
Type | Name | Description |
---|---|---|
TKey1 | startKey1 | The value of the first key property for the range start. |
System.Boolean | isStartOpen | Indicates whether the start side of the interval is open or closed. |
TKey1 | endKey1 | The value of the first key property for the range end. |
System.Boolean | isEndOpen | Indicates whether the end side of the interval is open or closed. |
ScanDirection | scanDirection | Indicates a direction in which to scan the index. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | All objects from the index that satisfy the required condition. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | If ObjectModel has been disposed. |