queue.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
---------------------------> Sather 1.1 source file <--------------------------
-- queue.sa: Standard queue
-- Author: Benedict A. Gomes <gomes@icsi.berkeley.edu>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: queue.sa,v 1.4 1996/07/16 04:38:16 holger Exp $
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
abstract class $QUEUE{T} < $DISPENSER{T}
abstract class $QUEUE{T} < $DISPENSER{T} is
-- Abstract queue
-- size: INT;
-- current: T;
-- remove: T;
-- Return the topmost element of the queue and advance
-- str: STR;
-- copy: SAME;
-- has(e: T): BOOL;
top: T;
-- Return the topmost element (alias for current)
enq(elt:T);
-- Enqueue the element "elt"
is_empty: BOOL;
-- Is the queue empty
elt!: T;
-- Return the elements in queue order (without removing them)
-- i.e. return them in the same order as "remove" would
end;