Show / Hide Table of Contents

    Interface ISortedDictionary<K, V>

    A dictionary with sorted keys.

    Inherited Members
    IDictionary<K, V>.EqualityComparer
    IDictionary<K, V>.Item[K]
    IDictionary<K, V>.IsReadOnly
    IDictionary<K, V>.Keys
    IDictionary<K, V>.Values
    IDictionary<K, V>.Func
    IDictionary<K, V>.Add(K, V)
    IDictionary<K, V>.AddAll<U, W>(System.Collections.Generic.IEnumerable<KeyValuePair<U, W>>)
    IDictionary<K, V>.ContainsSpeed
    IDictionary<K, V>.ContainsAll<H>(System.Collections.Generic.IEnumerable<H>)
    IDictionary<K, V>.Remove(K)
    IDictionary<K, V>.Remove(K, V)
    IDictionary<K, V>.Clear()
    IDictionary<K, V>.Contains(K)
    IDictionary<K, V>.Find(K, V)
    IDictionary<K, V>.Update(K, V)
    IDictionary<K, V>.Update(K, V, V)
    IDictionary<K, V>.FindOrAdd(K, V)
    IDictionary<K, V>.UpdateOrAdd(K, V)
    IDictionary<K, V>.UpdateOrAdd(K, V, V)
    IDictionary<K, V>.Check()
    ICollectionValue<KeyValuePair<K, V>>.ListenableEvents
    ICollectionValue<KeyValuePair<K, V>>.ActiveEvents
    ICollectionValue<KeyValuePair<K, V>>.CollectionChanged
    ICollectionValue<KeyValuePair<K, V>>.CollectionCleared
    ICollectionValue<KeyValuePair<K, V>>.ItemsAdded
    ICollectionValue<KeyValuePair<K, V>>.ItemInserted
    ICollectionValue<KeyValuePair<K, V>>.ItemsRemoved
    ICollectionValue<KeyValuePair<K, V>>.ItemRemovedAt
    ICollectionValue<KeyValuePair<K, V>>.IsEmpty
    ICollectionValue<KeyValuePair<K, V>>.Count
    ICollectionValue<KeyValuePair<K, V>>.CountSpeed
    ICollectionValue<KeyValuePair<K, V>>.CopyTo(KeyValuePair<K, V>[], Int32)
    ICollectionValue<KeyValuePair<K, V>>.ToArray()
    ICollectionValue<KeyValuePair<K, V>>.Apply(Action<KeyValuePair<K, V>>)
    ICollectionValue<KeyValuePair<K, V>>.Exists(Func<KeyValuePair<K, V>, Boolean>)
    ICollectionValue<KeyValuePair<K, V>>.Find(Func<KeyValuePair<K, V>, Boolean>, KeyValuePair<K, V>)
    ICollectionValue<KeyValuePair<K, V>>.All(Func<KeyValuePair<K, V>, Boolean>)
    ICollectionValue<KeyValuePair<K, V>>.Choose()
    ICollectionValue<KeyValuePair<K, V>>.Filter(Func<KeyValuePair<K, V>, Boolean>)
    IShowable.Show(System.Text.StringBuilder, Int32, IFormatProvider)
    Namespace: Lucene.Net.Support.C5
    Assembly: Lucene.Net.dll
    Syntax
    public interface ISortedDictionary<K, V> : IDictionary<K, V>, ICollectionValue<KeyValuePair<K, V>>, System.Collections.Generic.IEnumerable<KeyValuePair<K, V>>, IShowable, IFormattable
    Type Parameters
    Name Description
    K
    V

    Properties

    | Improve this Doc View Source

    Comparer

    The key comparer used by this dictionary.

    Declaration
    System.Collections.Generic.IComparer<K> Comparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IComparer<K>
    | Improve this Doc View Source

    Keys

    Declaration
    ISorted<K> Keys { get; }
    Property Value
    Type Description
    ISorted<K>

    Methods

    | Improve this Doc View Source

    AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K, V>>)

    Add all the items from another collection with an enumeration order that is increasing in the items.

    Declaration
    void AddSorted(System.Collections.Generic.IEnumerable<KeyValuePair<K, V>> items)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<KeyValuePair<K, V>> items

    The collection to add.

    | Improve this Doc View Source

    Cut(IComparable<K>, out KeyValuePair<K, V>, out Boolean, out KeyValuePair<K, V>, out Boolean)

    Given a "cut" function from the items of the sorted collection to

    int
    whose only sign changes when going through items in increasing order can be

    The "cut" function is supplied as the

    CompareTo
    method of an object
    c
    implementing

    IComparable<K>
    .

    A typical example is the case where

    K
    is comparable and

    c
    is itself of type
    K
    .

    This method performs a search in the sorted collection for the ranges in which the "cut" function is negative, zero respectively positive. If

    K
    is comparable and
    c
    is of type
    K
    , this is a safe way (no exceptions thrown) to find predecessor and successor of
    c
    .

    If the supplied cut function does not satisfy the sign-change condition, the result of this call is undefined.

    Declaration
    bool Cut(IComparable<K> cutFunction, out KeyValuePair<K, V> lowEntry, out bool lowIsValid, out KeyValuePair<K, V> highEntry, out bool highIsValid)
    Parameters
    Type Name Description
    IComparable<K> cutFunction

    The cut function

    K
    to
    int
    , given by the
    CompareTo
    method of an object implementing

    IComparable<K>
    .
    KeyValuePair<K, V> lowEntry

    Returns the largest item in the collection, where the cut function is positive (if any).

    System.Boolean lowIsValid

    Returns true if the cut function is positive somewhere on this collection.

    KeyValuePair<K, V> highEntry

    Returns the least item in the collection, where the cut function is negative (if any).

    System.Boolean highIsValid

    Returns true if the cut function is negative somewhere on this collection.

    Returns
    Type Description
    System.Boolean

    True if the cut function is zero somewhere on this collection.

    | Improve this Doc View Source

    DeleteMax()

    Remove the largest item from this sorted collection.

    Declaration
    KeyValuePair<K, V> DeleteMax()
    Returns
    Type Description
    KeyValuePair<K, V>

    The removed item.

    Exceptions
    Type Condition
    NoSuchItemException

    if the collection is empty.

    | Improve this Doc View Source

    DeleteMin()

    Remove the least item from this sorted collection.

    Declaration
    KeyValuePair<K, V> DeleteMin()
    Returns
    Type Description
    KeyValuePair<K, V>

    The removed item.

    Exceptions
    Type Condition
    NoSuchItemException

    if the collection is empty.

    | Improve this Doc View Source

    FindMax()

    Find the current largest item of this sorted collection.

    Declaration
    KeyValuePair<K, V> FindMax()
    Returns
    Type Description
    KeyValuePair<K, V>

    The largest item.

    Exceptions
    Type Condition
    NoSuchItemException

    if the collection is empty.

    | Improve this Doc View Source

    FindMin()

    Find the current least item of this sorted collection.

    Declaration
    KeyValuePair<K, V> FindMin()
    Returns
    Type Description
    KeyValuePair<K, V>

    The least item.

    Exceptions
    Type Condition
    NoSuchItemException

    if the collection is empty.

    | Improve this Doc View Source

    Predecessor(K)

    Find the entry with the largest key less than a given key.

    Declaration
    KeyValuePair<K, V> Predecessor(K key)
    Parameters
    Type Name Description
    K key

    The key to compare to

    Returns
    Type Description
    KeyValuePair<K, V>

    The entry

    Exceptions
    Type Condition
    NoSuchItemException

    if there is no such entry.

    | Improve this Doc View Source

    RangeAll()

    Create a directed collection with the same items as this collection.

    The returned collection is not a copy but a view into the collection.

    The view is fragile in the sense that changes to the underlying collection will invalidate the view so that further operations on the view throws InvalidView exceptions.

    Declaration
    IDirectedCollectionValue<KeyValuePair<K, V>> RangeAll()
    Returns
    Type Description
    IDirectedCollectionValue<KeyValuePair<K, V>>

    The result directed collection.

    | Improve this Doc View Source

    RangeFrom(K)

    Query this sorted collection for items greater than or equal to a supplied value.

    The returned collection is not a copy but a view into the collection.

    The view is fragile in the sense that changes to the underlying collection will invalidate the view so that further operations on the view throws InvalidView exceptions.

    Declaration
    IDirectedEnumerable<KeyValuePair<K, V>> RangeFrom(K bot)
    Parameters
    Type Name Description
    K bot

    The lower bound (inclusive).

    Returns
    Type Description
    IDirectedEnumerable<KeyValuePair<K, V>>

    The result directed collection.

    | Improve this Doc View Source

    RangeFromTo(K, K)

    Query this sorted collection for items between two supplied values.

    The returned collection is not a copy but a view into the collection.

    The view is fragile in the sense that changes to the underlying collection will invalidate the view so that further operations on the view throws InvalidView exceptions.

    Declaration
    IDirectedEnumerable<KeyValuePair<K, V>> RangeFromTo(K lowerBound, K upperBound)
    Parameters
    Type Name Description
    K lowerBound

    The lower bound (inclusive).

    K upperBound

    The upper bound (exclusive).

    Returns
    Type Description
    IDirectedEnumerable<KeyValuePair<K, V>>

    The result directed collection.

    | Improve this Doc View Source

    RangeTo(K)

    Query this sorted collection for items less than a supplied value.

    The returned collection is not a copy but a view into the collection.

    The view is fragile in the sense that changes to the underlying collection will invalidate the view so that further operations on the view throws InvalidView exceptions.

    Declaration
    IDirectedEnumerable<KeyValuePair<K, V>> RangeTo(K top)
    Parameters
    Type Name Description
    K top

    The upper bound (exclusive).

    Returns
    Type Description
    IDirectedEnumerable<KeyValuePair<K, V>>

    The result directed collection.

    | Improve this Doc View Source

    RemoveRangeFrom(K)

    Remove all items of this collection above or at a supplied threshold.

    Declaration
    void RemoveRangeFrom(K low)
    Parameters
    Type Name Description
    K low

    The lower threshold (inclusive).

    | Improve this Doc View Source

    RemoveRangeFromTo(K, K)

    Remove all items of this collection between two supplied thresholds.

    Declaration
    void RemoveRangeFromTo(K low, K hi)
    Parameters
    Type Name Description
    K low

    The lower threshold (inclusive).

    K hi

    The upper threshold (exclusive).

    | Improve this Doc View Source

    RemoveRangeTo(K)

    Remove all items of this collection below a supplied threshold.

    Declaration
    void RemoveRangeTo(K hi)
    Parameters
    Type Name Description
    K hi

    The upper threshold (exclusive).

    | Improve this Doc View Source

    Successor(K)

    Find the entry with the least key greater than a given key.

    Declaration
    KeyValuePair<K, V> Successor(K key)
    Parameters
    Type Name Description
    K key

    The key to compare to

    Returns
    Type Description
    KeyValuePair<K, V>

    The entry

    Exceptions
    Type Condition
    NoSuchItemException

    if there is no such entry.

    | Improve this Doc View Source

    TryPredecessor(K, out KeyValuePair<K, V>)

    Find the entry in the dictionary whose key is the predecessor of the specified key.

    Declaration
    bool TryPredecessor(K key, out KeyValuePair<K, V> res)
    Parameters
    Type Name Description
    K key

    The key

    KeyValuePair<K, V> res

    The predecessor, if any

    Returns
    Type Description
    System.Boolean

    True if key has a predecessor

    | Improve this Doc View Source

    TrySuccessor(K, out KeyValuePair<K, V>)

    Find the entry in the dictionary whose key is the successor of the specified key.

    Declaration
    bool TrySuccessor(K key, out KeyValuePair<K, V> res)
    Parameters
    Type Name Description
    K key

    The key

    KeyValuePair<K, V> res

    The successor, if any

    Returns
    Type Description
    System.Boolean

    True if the key has a successor

    | Improve this Doc View Source

    TryWeakPredecessor(K, out KeyValuePair<K, V>)

    Find the entry in the dictionary whose key is the weak predecessor of the specified key.

    Declaration
    bool TryWeakPredecessor(K key, out KeyValuePair<K, V> res)
    Parameters
    Type Name Description
    K key

    The key

    KeyValuePair<K, V> res

    The predecessor, if any

    Returns
    Type Description
    System.Boolean

    True if key has a weak predecessor

    | Improve this Doc View Source

    TryWeakSuccessor(K, out KeyValuePair<K, V>)

    Find the entry in the dictionary whose key is the weak successor of the specified key.

    Declaration
    bool TryWeakSuccessor(K key, out KeyValuePair<K, V> res)
    Parameters
    Type Name Description
    K key

    The key

    KeyValuePair<K, V> res

    The weak successor, if any

    Returns
    Type Description
    System.Boolean

    True if the key has a weak successor

    | Improve this Doc View Source

    WeakPredecessor(K)

    Find the entry with the largest key less than or equal to a given key.

    Declaration
    KeyValuePair<K, V> WeakPredecessor(K key)
    Parameters
    Type Name Description
    K key

    The key to compare to

    Returns
    Type Description
    KeyValuePair<K, V>

    The entry

    Exceptions
    Type Condition
    NoSuchItemException

    if there is no such entry.

    | Improve this Doc View Source

    WeakSuccessor(K)

    Find the entry with the least key greater than or equal to a given key.

    Declaration
    KeyValuePair<K, V> WeakSuccessor(K key)
    Parameters
    Type Name Description
    K key

    The key to compare to

    Returns
    Type Description
    KeyValuePair<K, V>

    The entry

    Exceptions
    Type Condition
    NoSuchItemException

    if there is no such entry.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)