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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years ago) by manus
File size: 1952 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 "Tables whose keys are integers in a contiguous interval";
5
6 status: "See notice at end of class";
7 names: indexable, access;
8 access: index, membership;
9 contents: generic;
10 date: "$Date$";
11 revision: "$Revision$"
12
13 deferred class INDEXABLE [G, H -> INTEGER] inherit
14
15 TABLE [G, H]
16 rename
17 valid_key as valid_index
18 redefine
19 put, valid_index
20 end
21
22 feature -- Measurement
23
24 index_set: INTEGER_INTERVAL is
25 -- Range of acceptable indexes
26 deferred
27 ensure
28 not_void: Result /= Void
29 end
30
31 feature -- Status report
32
33 valid_index (i: H): BOOLEAN is
34 -- Is `i' a valid index?
35 deferred
36 ensure then
37 only_if_in_index_set:
38 Result implies
39 ((i >= index_set.lower) and
40 (i <= index_set.upper))
41 end
42
43 feature -- Element change
44
45 put (v: G; k: H) is
46 -- Associate value `v' with key `k'.
47 deferred
48 ensure then
49 insertion_done: item (k) = v
50 end;
51
52 invariant
53
54 index_set_not_void: index_set /= Void
55
56 end -- class INDEXABLE
57
58
59 --|----------------------------------------------------------------
60 --| EiffelBase: Library of reusable components for Eiffel.
61 --| Copyright (c) 1993-2006 University of Southern California and contributors.
62 --| For ISE customers the original versions are an ISE product
63 --| covered by the ISE Eiffel license and support agreements.
64 --| EiffelBase may now be used by anyone as FREE SOFTWARE to
65 --| develop any product, public-domain or commercial, without
66 --| payment to ISE, under the terms of the ISE Free Eiffel Library
67 --| License (IFELL) at http://eiffel.com/products/base/license.html.
68 --|
69 --| Interactive Software Engineering Inc.
70 --| ISE Building, 2nd floor
71 --| 270 Storke Road, Goleta, CA 93117 USA
72 --| Telephone 805-685-1006, Fax 805-685-6869
73 --| Electronic mail <info@eiffel.com>
74 --| Customer support e-mail <support@eiffel.com>
75 --| For latest info see award-winning pages: http://eiffel.com
76 --|----------------------------------------------------------------
77

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23