Copyright © 2009-2011 Zuse Institute Berlin
Version: $Id$
Authors: Christian Hennig (hennig@zib.de).
abstract datatype: fix_queue(Element)
new/1 | Creates a new fixed-size queue. |
add/2 | Adds an element to the given queue. |
add_unique_head/4 | Adds an element to the given queue. |
map/2 | Maps a function to all elements of the given queue. |
remove/3 | |
length/1 | |
max_length/1 | |
queue/1 |
new(MaxLength :: pos_integer()) -> fix_queue(any())
Creates a new fixed-size queue.
Adds an element to the given queue.
add_unique_head(Element, Queue :: fix_queue(Element), EqFun :: fun((Old :: Element, New :: Element) -> boolean()), SelectFun :: fun((Old :: Element, New :: Element) -> Element)) -> fix_queue(Element)
Adds an element to the given queue. If there is already an equal element at the "head" (rear) of the queue, it will be replaced by the element selected by SelectFun. Note that this is much cheaper than checking all elements!
map(Fun :: fun((Element) -> X), Queue :: fix_queue(Element)) -> [X]
Maps a function to all elements of the given queue.
remove(Element, Queue :: fix_queue(Element), EqFun :: fun((Element, Element) -> boolean())) -> fix_queue(Element)
length(X1 :: fix_queue(any())) -> non_neg_integer()
max_length(X1 :: fix_queue(any())) -> pos_integer()
queue(X1 :: fix_queue(Element)) -> queue:queue(Element)
Generated by EDoc, Sep 11 2020, 15:25:28.