container.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- container_alg.sa: Operations that work by inclusion on any container
-- Author: Benedict A. Gomes <gomes@tiramisu.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: container.sa,v 1.2 1996/04/09 10:04:49 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 $CONTAINER{ETP} < $ELT{ETP}

abstract class $CONTAINER{ETP} < $ELT{ETP} is -- The basic abstract container type -- Does not have a create:SAME method, since this does not make sense -- for arrays and other indexible types, where the create should -- take SAME as an argument -- Inherits: elt!, str copy: $CONTAINER{ETP}; -- Should be "SAME" -- Return a copy of the current container -- post result = self size: INT; -- Number of elements actually inserted has(e: ETP): BOOL; -- pre ~void(self) -- True if the container contains the element "e" end;