Click or drag to resize

PriorityQueueBaseTElement Class

Base class for all priority queues. A priority queue is a special queue: the elements added to the queue are stored in the order of the priority they have. Grabbing the first element from a queue is therefore grabbing the element with the highest priority. See: http://en.wikipedia.org/wiki/Priority_queue
Inheritance Hierarchy

Namespace:  SD.Tools.Algorithmia.PriorityQueues
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.3.3.0 (1.3.18.0209)
Syntax
public abstract class PriorityQueueBase<TElement> : IEnumerable<TElement>, 
	IEnumerable

Type Parameters

TElement
the type of the element in the queue

The PriorityQueueBaseTElement type exposes the following members.

Constructors
  NameDescription
Protected methodPriorityQueueBaseTElement
Initializes a new instance of the PriorityQueueBaseTElement class.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of elements in the queue
Protected propertyPriorityComparison
Gets the priority comparison.
Top
Methods
  NameDescription
Public methodAdd
Adds the specified element to the queue
Public methodClear
Clears the queue.
Public methodContains
Determines whether the queue contains the element specified
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetEnumerator
Gets the enumerator for this queue
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPeek
Peeks at the first element of the queue (the one with the highest priority, according to the priority comparison) and returns that element without removing it
Public methodRemove
Removes the first element from the queue, if the queue isn't empty.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodSetEqualTElement(IEnumerableTElement)Overloaded.
Checks whether the enumerable to compare with is equal to the source enumerable, element wise. If elements are in a different order, the method will still return true. This is different from SequenceEqual which does take order into account
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodSetEqualTElement(IEnumerableTElement, IEqualityComparerTElement)Overloaded.
Checks whether the enumerable to compare with is equal to the source enumerable, element wise. If elements are in a different order, the method will still return true. This is different from SequenceEqual which does take order into account
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodToFilteringBindingListTElement
Converts the passed in enumerable to a FilteringBindingList
(Defined by ExtensionMethods.)
Public Extension MethodToHashSetTElement
Creates a new hashset and adds the source to it.
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodToListSafeTElement
Converts the passed in enumerable to a List(Of T). If toEnumerate is a CommandifiedList(Of T) it will lock on its SyncRoot if it's a synchronized CommandifiedList. if it's not a commandified list, it will simply call ToList() on the enumerable. If toEnumerate is null, null is returned.
(Defined by ExtensionMethods.)
Public Extension MethodToReadOnlyCollectionTDestination
Converts the enumerable to a ReadOnlyCollection.
(Defined by IEnumerableExtensionMethods.)
Top
Explicit Interface Implementations
Remarks
If you store value types in this queue, be aware that Peek() and Remove() on an empty queue will return the default value for the value type used, e.g. 0 for a priority queue with Int32 values.
See Also