PriorityQueueT Class |
Namespace: Ookii.Collections.Generic
The PriorityQueueT type exposes the following members.
Name | Description | |
---|---|---|
PriorityQueueT |
Initializes a new instance of the PriorityQueueT class that is empty,
has the default initial capacity, and uses the default IComparerT
implementation for the element type.
| |
PriorityQueueT(IComparerT) |
Initializes a new instance of the PriorityQueueT class that is empty, has the default initial capacity, and uses the
specified IComparerT implementation to compare elements.
| |
PriorityQueueT(IEnumerableT) |
Initializes a new instance of the PriorityQueueT that contains elements copied from the specified IEnumerableT
and uses the default IComparerT implementation for the element type.
| |
PriorityQueueT(IEnumerableT, IComparerT) |
Initializes a new instance of the PriorityQueueT that contains elements
copied from the specified IEnumerableT and that uses the specified
IComparerT implementation to compare keys.
| |
PriorityQueueT(Int32, IComparerT) |
Initializes a new instance of the PriorityQueueT class that is empty,
has the specified initial capacity, and uses the specified IComparerT
implementation to compare elements.
|
Name | Description | |
---|---|---|
Capacity |
Gets or sets the total number of elements the internal data structure can hold without resizing.
| |
Comparer |
Gets the IComparerT that is used to compare the elements of the
priority queue.
| |
Count |
Gets the number of elements contained in the PriorityQueueT.
|
Name | Description | |
---|---|---|
AdjustFirstItem |
Indicates that the current first item of the PriorityQueueT was modified and its priority has to be re-evaluated.
| |
Clear |
Removes all objects from the PriorityQueueT.
| |
Contains |
Determines whether an element is in the PriorityQueueT.
| |
CopyTo |
Copies the PriorityQueueT elements to an existing one-dimensional Array, starting at the specified array index.
| |
Dequeue |
Removes and returns the element with the lowest value from the PriorityQueueT.
| |
Enqueue |
Adds an object to the PriorityQueueT.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetEnumerator |
Returns an enumerator that iterates through the values in the PriorityQueueT.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Peek |
Returns the object with the lowest value in the PriorityQueueT without removing it.
| |
ToArray |
Copies the PriorityQueueT elements to a new array.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TrimExcess |
Sets the capacity to the actual number of elements in the PriorityQueueT, if that number is less than a threshold value.
|
The items must be immutable as long as they are in the PriorityQueueT. The only exception is the first item, which you may modify if you call AdjustFirstItem immediately afterward.
The PriorityQueueT always places the element with the lowest value at the front. If you wish to have the element with the highest value at the front, use a constructor that takes a IComparerT, and pass an instance of the InvertedComparerT class.