Interface IZoneTreeIterator<TKey, TValue>
The ZoneTree iterator interface.
Inherited Members
Namespace: Tenray.ZoneTree
Assembly: ZoneTree.dll
Syntax
public interface IZoneTreeIterator<TKey, TValue> : IDisposable
Type Parameters
Name | Description |
---|---|
TKey | The key type |
TValue | The value type |
Properties
| Improve this Doc View SourceAutoRefresh
If true, the iterator automatically refreshes itself to include the latest segments.
Declaration
bool AutoRefresh { get; }
Property Value
Type | Description |
---|---|
bool |
Current
Gets the current element at the iterator's position.
Declaration
KeyValuePair<TKey, TValue> Current { get; }
Property Value
Type | Description |
---|---|
KeyValuePair<TKey, TValue> |
CurrentKey
Returns the element key if there is an element in the iterator position.
Declaration
TKey CurrentKey { get; }
Property Value
Type | Description |
---|---|
TKey |
CurrentValue
Returns the element value if there is an element in the iterator position.
Declaration
TValue CurrentValue { get; }
Property Value
Type | Description |
---|---|
TValue |
HasCurrent
Returns true if there is an element in the iterator position.
Declaration
bool HasCurrent { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Improve this Doc View SourceNext()
Iterates to the next element.
Declaration
bool Next()
Returns
Type | Description |
---|---|
bool | true if next element exists, otherwise false. |
Refresh()
Refreshes the iterator with latest segments. If AutoRefresh property is true, there is no need to call refresh manually.
Declaration
void Refresh()
Seek(in TKey)
Seeks the iterator to the position where next item is the key. If key does not exist, forward iterator's next item is the first greater item (prefix search forward). reverse iterator's next item is the last smaller item (prefix search backward). Complexity: O(log(N))
Declaration
void Seek(in TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The search key |
SeekFirst()
Seeks the first element of the iterator.
Declaration
void SeekFirst()