dispenser.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
---------------------------> Sather 1.1 source file <--------------------------
-- dispenser.sa: Dispenser abstraction
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: dispenser.sa,v 1.2 1996/04/09 10:04:50 borisv 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 $DISPENSER{ETP} < $CONTAINER{ETP},$STR
abstract class $DISPENSER{ETP} < $CONTAINER{ETP},$STR is
-- A dispenser is an abstraction that only permits the removal
-- of one element at a time.
-- This abstraction just permits the non-modifying operations
-- and is mainly to organize the collection of classes (to ensure
-- that they all have certain basic features like size).
-- We do not currently believe that an abstract dispenser will show
-- up in actual code...
size: INT;
-- Number of items in the dispenser
current: ETP;
-- Return the current item
remove: ETP;
-- Return the current item and advance
elt!: ETP;
-- Return the elements of the dispenser in some *undefined* order.
-- Particular abstractions might define a stronger ordering relation
end;