BlockIndex

Description

class Tinman.Core.Database.BlockIndex
<TKey>
<TValue>

Derived from

BlockIndexBase abstract

Extended by

SimpleBlockIndex sealed

Abstract base class for persistent dictionaries that use a block-based index data structure (B-Tree) for efficiency.

Public / Constructors

Create


public static method Create → (4)

storage in : BlockStorage

[not-null]
The persistent block storage.

order in : IBlockIndexOrder<TKey, TValue>

[not-null]
The block index sort order handler.

format in : IBlockIndexFormat<TValue>

[not-null]
The block index binary format handler.

root in : BlockIdSlot

The block index root storage location.

returns → BlockIndex<TKey, TValue>

The created BlockIndex object.

Creates a new block index in the given block storage.

The returned block index belongs to storage in and will be disposed with it.

IOException

If an I/O error has occurred.

New


public static method New → (5)

create in : bool

Create a new block index or open an existing one?

storage in : BlockStorage

[not-null]
The persistent block storage.

order in : IBlockIndexOrder<TKey, TValue>

[not-null]
The block index sort order handler.

format in : IBlockIndexFormat<TValue>

[not-null]
The block index binary format handler.

root in : BlockIdSlot

The block index root storage location.

returns → BlockIndex<TKey, TValue>

The created BlockIndex object.

Creates a new block index in the given block storage.

The returned block index belongs to storage in and will be disposed with it.

IOException

If an I/O error has occurred.

Open


public static method Open → (4)

storage in : BlockStorage

[not-null]
The persistent block storage.

order in : IBlockIndexOrder<TKey, TValue>

[not-null]
The block index sort order handler.

format in : IBlockIndexFormat<TValue>

[not-null]
The block index binary format handler.

root in : BlockIdSlot

The block index root storage location.

returns → BlockIndex<TKey, TValue>

The opened BlockIndex object.

Opens an existing block index in the given block storage.

The returned block index belong to storage in and will be disposed with it.

IOException

If an I/O error has occurred.

Public / Methods

Delete​Key


[BeginWriteEnd]
public method DeleteKey → (1)

key in : TKey

Key of the entry to delete.

Deletes an entry from the block tree.

If no entry exists for the given key, the method silently returns.

IOException

If an I/O error has occurred.

Delete​Value


[BeginWriteEnd]
public method DeleteValue → (1)

value in : TValue

Value of the entry to delete.

Deletes an entry from the block tree.

If no entry exists for the given key, the method silently returns.

IOException

If an I/O error has occurred.

Find


[BeginEnd]
public method Find → (2)

key in : TKey

Key of the entry to find.

defaultValue opt : TValue = default(TValue)

Default value to return if no entry exists for key in.

returns → TValue

The value of the found entry or defaultValue opt if not found.

Tries to find an entry in the block tree.

IOException

If an I/O error has occurred.

Find​All


[BeginEnd]
public method FindAll → (1)

result opt : CollectorDelegate<TValue> = null

Optional collector for found entries.

returns → int32

Number of entries.

Finds all entries.

IOException

If an I/O error has occurred.

Find​From


[BeginEnd]
public method FindFrom → (3)

from in : TKey

The first key to find.

fromIncluded in : bool

Return from in as a result?

result opt : CollectorDelegate<TValue> = null

Optional collector for found entries.

returns → int32

Number of found entries.

Finds all entries starting at the given key.

IOException

If an I/O error has occurred.

Find​From​To


[BeginEnd]
public method FindFromTo → (5)

from in : TKey

The first key to find.

fromIncluded in : bool

Return from in as a result?

to in : TKey

The last key to find.

toIncluded in : bool

Return to in as a result?

result opt : CollectorDelegate<TValue> = null

Optional collector for found entries.

returns → int32

Number of found entries.

Finds all entries that are included in the given key range.

IOException

If an I/O error has occurred.

Find​Maximum


[BeginEnd]
public method FindMaximum → (2)

upper in : TKey

The upper bound for entry key values (inclusive).

defaultValue opt : TValue = default(TValue)

Default value to return if no entry is found.

returns → TValue

The found entry or defaultValue opt if not found.

Tries to find an entry in the block tree.

All entries that have keys less than or equal to the given upper bound are included in the search. From all included entries, the one with the biggest key value is returned.

IOException

If an I/O error has occurred.

Find​Minimum


[BeginEnd]
public method FindMinimum → (2)

lower in : TKey

The lower bound for entry key values (inclusive).

defaultValue opt : TValue = default(TValue)

Default value to return if no entry is found.

returns → TValue

The value of the entry or defaultValue opt if not found.

Tries to find an entry in the block tree.

All entries that have keys greater than or equal to the given lower bound are included in the search. From all included entries, the one with the smallest key value is returned.

IOException

If an I/O error has occurred.

Find​To


[BeginEnd]
public method FindTo → (3)

to in : TKey

The last key to find.

toIncluded in : bool

Return to in as a result?

result opt : CollectorDelegate<TValue> = null

Optional collector for found entries.

returns → int32

Number of found entries.

Finds all entries up to the given key.

IOException

If an I/O error has occurred.

Insert


[BeginWriteEnd]
public method Insert → (1)

value in : TValue

Value of the entry to insert or update.

Inserts or updates an entry in the block tree.

If an entry already exists for the given value in, it will be updated. If no entry exists, a new one will be inserted into the index.

IOException

If an I/O error has occurred.

Public / Attributes

Is​Empty


[BeginEnd]
public attribute IsEmpty → (get)

value : bool

true if the index is empty, false if there is at least one entry.

Checks if this block index is empty (i.e. has no entries at all).

Maximum​Key


[BeginEnd]
public attribute MaximumKey → (get)

value : TKey

The maximum entry key.

Returns the maximum entry key in the index.

IOException

If an I/O error has occurred.

Maximum​Value


[BeginEnd]
public attribute MaximumValue → (get)

value : TValue

The maximum entry value.

Returns the maximum entry value in the index.

IOException

If an I/O error has occurred.

Minimum​Key


[BeginEnd]
public attribute MinimumKey → (get)

value : TKey

The minimum entry key.

Returns the minimum entry key in the index.

IOException

If an I/O error has occurred.

Minimum​Value


[BeginEnd]
public attribute MinimumValue → (get)

value : TValue

The minimum entry value.

Returns the minimum entry value in the index.

IOException

If an I/O error has occurred.