Queue
Object Hierarchy:
Description:
[ Compact ]
public class Queue<G>
Contains the public fields of a Queue.
Content:
Creation methods:
Methods:
- public void clear ()
Removes all the elements in this.
- public bool is_empty ()
Returns true if the queue
is empty.
- public uint get_length ()
Returns the number of items in this.
- public void reverse ()
Reverses the order of the items in this
.
- public Queue copy ()
Copies a this.
- public unowned List<G> find (G data)
Finds the first link in this which
contains data
.
- public unowned List<G> find_custom (G data, CompareFunc<G> func)
- public unowned List<G> search<T> (T data, SearchFunc<T,G> func)
Finds an element in a Queue, using a
supplied function to find the desired element.
- public void sort (CompareDataFunc<G> compare_func)
Sorts this using compare_func
.
- public void push_head (owned G data)
Adds a new element at the head of the queue.
- public void push_tail (owned G data)
Adds a new element at the tail of the queue.
- public void push_nth (owned G data, int n)
Inserts a new element into this at
the given position.
- public G pop_head ()
Removes the first element of the queue and returns its data.
- public G pop_tail ()
Removes the last element of the queue and returns its data.
- public G pop_nth (uint n)
Removes the n
'th element of
this and returns its data.
- public weak G peek_head ()
Returns the first element of the queue.
- public weak G peek_tail ()
Returns the last element of the queue.
- public weak G peek_nth (uint n)
Returns the n
'th element of
this.
- public int index (G data)
Returns the position of the first element in
this which contains data
.
- public void remove (G data)
Removes the first element in this
that contains data
.
- public void remove_all (G data)
Remove all elements whose data equals data
from
this.
- public void delete_link (List<G> link)
Removes link_
from this
and frees it.
- public void unlink (List<G> link)
Unlinks link_
so that it will no longer be part of
this.
- public void insert_before (List<G> sibling, owned G data)
Inserts data
into this
before sibling
.
- public void insert_after (List<G> sibling, owned G data)
Inserts data
into this
after sibling
- public void insert_sorted (owned G data, CompareDataFunc<G> func)
Inserts data
into this
using func
to determine the new position.
Fields: