Priority  2
 All Classes Functions
Public Member Functions | Public Attributes | List of all members
Priority_Queue Class Reference

Priority Queue. More...

Public Member Functions

function GetAuthor ()
function GetName ()
function GetShortName ()
function GetDescription ()
function GetVersion ()
function GetDate ()
function CreateInstance ()
function GetCategory ()
function Insert (item, priority)
 Insert a new entry in the list.
function Pop ()
 Pop the first entry of the list.
function Peek ()
 Peek the first entry of the list.
function Count ()
 Get the amount of current items in the list.
function Exists (item)
 Check if an item exists in the list.

Public Attributes

 _queue = null
 _count = 0

Detailed Description

Priority Queue.

Peek and Pop always return the current lowest value in the list. Sort is done on insertion only.

Member Function Documentation

function Priority_Queue::Count ( )

Get the amount of current items in the list.

The complexity of this operation is O(1).

Returns
The amount of items currently in the list.
function Priority_Queue::Exists ( item  )

Check if an item exists in the list.

The complexity of this operation is O(n).

Parameters
itemThe item to check for.
Returns
True if the item is already in the list.
function Priority_Queue::Insert ( item  ,
priority   
)

Insert a new entry in the list.

The complexity of this operation is O(n).

Parameters
itemThe item to add to the list.
priorityThe priority this item has.
function Priority_Queue::Peek ( )

Peek the first entry of the list.

This is always the item with the lowest priority. The complexity of this operation is O(1).

Returns
The item of the entry with the lowest priority.
function Priority_Queue::Pop ( )

Pop the first entry of the list.

This is always the item with the lowest priority. The complexity of this operation is O(1).

Returns
The item of the entry with the lowest priority.

The documentation for this class was generated from the following files: