Show / Hide Table of Contents

    Interface IPriorityQueue<T>

    A generic collection of items prioritized by a comparison (order) relation. Supports adding items and reporting or removing extremal elements.

    When adding an item, the user may choose to have a handle allocated for this item in the queue. The resulting handle may be used for deleting the item even if not extremal, and for replacing the item. A priority queue typically only holds numeric priorities associated with some objects maintained separately in other collection objects.

    Inherited Members
    IExtensible<T>.IsReadOnly
    IExtensible<T>.AllowsDuplicates
    IExtensible<T>.EqualityComparer
    IExtensible<T>.DuplicatesByCounting
    IExtensible<T>.Add(T)
    IExtensible<T>.AddAll(System.Collections.Generic.IEnumerable<T>)
    IExtensible<T>.Check()
    ICollectionValue<T>.ListenableEvents
    ICollectionValue<T>.ActiveEvents
    ICollectionValue<T>.CollectionChanged
    ICollectionValue<T>.CollectionCleared
    ICollectionValue<T>.ItemsAdded
    ICollectionValue<T>.ItemInserted
    ICollectionValue<T>.ItemsRemoved
    ICollectionValue<T>.ItemRemovedAt
    ICollectionValue<T>.IsEmpty
    ICollectionValue<T>.Count
    ICollectionValue<T>.CountSpeed
    ICollectionValue<T>.CopyTo(T[], Int32)
    ICollectionValue<T>.ToArray()
    ICollectionValue<T>.Apply(Action<T>)
    ICollectionValue<T>.Exists(Func<T, Boolean>)
    ICollectionValue<T>.Find(Func<T, Boolean>, T)
    ICollectionValue<T>.All(Func<T, Boolean>)
    ICollectionValue<T>.Choose()
    ICollectionValue<T>.Filter(Func<T, Boolean>)
    IShowable.Show(System.Text.StringBuilder, Int32, IFormatProvider)
    Namespace: Lucene.Net.Support.C5
    Assembly: Lucene.Net.dll
    Syntax
    public interface IPriorityQueue<T> : IExtensible<T>, ICollectionValue<T>, System.Collections.Generic.IEnumerable<T>, IShowable, IFormattable
    Type Parameters
    Name Description
    T

    Properties

    | Improve this Doc View Source

    Comparer

    The comparer object supplied at creation time for this collection

    Declaration
    System.Collections.Generic.IComparer<T> Comparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IComparer<T>

    The comparer

    | Improve this Doc View Source

    Item[IPriorityQueueHandle<T>]

    Get or set the item corresponding to a handle. Throws exceptions on invalid handles.

    Declaration
    T this[IPriorityQueueHandle<T> handle] { get; set; }
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle
    Property Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    Add(ref IPriorityQueueHandle<T>, T)

    Add an item to the priority queue, receiving a handle for the item in the queue, or reusing an existing unused handle.

    Declaration
    bool Add(ref IPriorityQueueHandle<T> handle, T item)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    On output: a handle for the added item. On input: null for allocating a new handle, or a currently unused handle for reuse. A handle for reuse must be compatible with this priority queue, by being created by a priority queue of the same runtime type, but not necessarily the same priority queue object.

    T item
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Delete(IPriorityQueueHandle<T>)

    Delete an item with a handle from a priority queue

    Declaration
    T Delete(IPriorityQueueHandle<T> handle)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    The handle for the item. The handle will be invalidated, but reusable.

    Returns
    Type Description
    T

    The deleted item

    | Improve this Doc View Source

    DeleteMax()

    Remove the largest item from this priority queue.

    Declaration
    T DeleteMax()
    Returns
    Type Description
    T

    The removed item.

    | Improve this Doc View Source

    DeleteMax(out IPriorityQueueHandle<T>)

    Remove the largest item from this priority queue.

    Declaration
    T DeleteMax(out IPriorityQueueHandle<T> handle)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    On return: the handle of the removed item.

    Returns
    Type Description
    T

    The removed item.

    | Improve this Doc View Source

    DeleteMin()

    Remove the least item from this priority queue.

    Declaration
    T DeleteMin()
    Returns
    Type Description
    T

    The removed item.

    | Improve this Doc View Source

    DeleteMin(out IPriorityQueueHandle<T>)

    Remove the least item from this priority queue.

    Declaration
    T DeleteMin(out IPriorityQueueHandle<T> handle)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    On return: the handle of the removed item.

    Returns
    Type Description
    T

    The removed item.

    | Improve this Doc View Source

    Find(IPriorityQueueHandle<T>, out T)

    Check if the entry corresponding to a handle is in the priority queue.

    Declaration
    bool Find(IPriorityQueueHandle<T> handle, out T item)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle
    T item
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    FindMax()

    Find the current largest item of this priority queue.

    Declaration
    T FindMax()
    Returns
    Type Description
    T

    The largest item.

    | Improve this Doc View Source

    FindMax(out IPriorityQueueHandle<T>)

    Find the current largest item of this priority queue.

    Declaration
    T FindMax(out IPriorityQueueHandle<T> handle)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    On return: the handle of the item.

    Returns
    Type Description
    T

    The largest item.

    | Improve this Doc View Source

    FindMin()

    Find the current least item of this priority queue.

    Declaration
    T FindMin()
    Returns
    Type Description
    T

    The least item.

    | Improve this Doc View Source

    FindMin(out IPriorityQueueHandle<T>)

    Find the current least item of this priority queue.

    Declaration
    T FindMin(out IPriorityQueueHandle<T> handle)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    On return: the handle of the item.

    Returns
    Type Description
    T

    The least item.

    | Improve this Doc View Source

    Replace(IPriorityQueueHandle<T>, T)

    Replace an item with a handle in a priority queue with a new item. Typically used for changing the priority of some queued object.

    Declaration
    T Replace(IPriorityQueueHandle<T> handle, T item)
    Parameters
    Type Name Description
    IPriorityQueueHandle<T> handle

    The handle for the old item

    T item

    The new item

    Returns
    Type Description
    T

    The old item

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