/[eiffelstudio]/trunk/eweasel/tests/incr071/bag.e
ViewVC logotype

Contents of /trunk/eweasel/tests/incr071/bag.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years, 3 months ago) by manus
File size: 1784 byte(s)
Moved from trunk/Src/eweasel to trunk/eweasel so that a simple checkout of the source code is not penalized by the lenghty process of checking out all the tests of eweasel.
1 indexing
2
3 description:
4 "Collections of items, where each item may occur zero %
5 %or more times, and the number of occurrences is meaningful.";
6
7 status: "See notice at end of class";
8 names: bag, access;
9 access: membership;
10 contents: generic;
11 date: "$Date$";
12 revision: "$Revision$"
13
14 deferred class BAG [G] inherit
15
16 COLLECTION [G]
17 redefine
18 extend
19 end
20
21 feature -- Measurement
22
23 occurrences (v: G): INTEGER is
24 -- Number of times `v' appears in structure
25 -- (Reference or object equality,
26 -- based on `object_comparison'.)
27 deferred
28 ensure
29 non_negative_occurrences: Result >= 0
30 end;
31
32 feature -- Element change
33
34 extend (v: G) is
35 -- Add a new occurrence of `v'.
36 deferred
37 ensure then
38 one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
39 end;
40
41 end -- class BAG
42
43
44 --|----------------------------------------------------------------
45 --| EiffelBase: Library of reusable components for Eiffel.
46 --| Copyright (c) 1993-2006 University of Southern California and contributors.
47 --| For ISE customers the original versions are an ISE product
48 --| covered by the ISE Eiffel license and support agreements.
49 --| EiffelBase may now be used by anyone as FREE SOFTWARE to
50 --| develop any product, public-domain or commercial, without
51 --| payment to ISE, under the terms of the ISE Free Eiffel Library
52 --| License (IFELL) at http://eiffel.com/products/base/license.html.
53 --|
54 --| Interactive Software Engineering Inc.
55 --| ISE Building, 2nd floor
56 --| 270 Storke Road, Goleta, CA 93117 USA
57 --| Telephone 805-685-1006, Fax 805-685-6869
58 --| Electronic mail <info@eiffel.com>
59 --| Customer support e-mail <support@eiffel.com>
60 --| For latest info see award-winning pages: http://eiffel.com
61 --|----------------------------------------------------------------
62

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23