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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years, 2 months ago) by manus
File size: 2820 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 "Infinite sequences, indexed by integers"
5
6 status: "See notice at end of class"
7 names: countable_sequence, infinite_sequence;
8 access: cursor, membership;
9 contents: generic;
10 date: "$Date$"
11 revision: "$Revision$"
12
13 deferred class COUNTABLE_SEQUENCE [G]
14
15 inherit
16
17 COUNTABLE [G]
18 rename
19 item as i_th
20 end
21
22 ACTIVE [G]
23 export
24 {NONE}
25 fill, prune_all, put,
26 prune,
27 wipe_out, replace, remove
28 end
29
30 LINEAR [G]
31 redefine
32 linear_representation
33 end
34
35 feature -- Access
36
37 index: INTEGER
38 -- Index of current position
39
40 item: G is
41 -- Item at current position
42 do
43 Result := i_th (index)
44 end
45
46 feature -- Status report
47
48 after: BOOLEAN is False
49 -- Is current position past last item? (Answer: no.)
50
51 extendible: BOOLEAN is False
52 -- May items be added? (Answer: no.)
53
54 prunable: BOOLEAN is False
55 -- May items be removed? (Answer: no.)
56
57 readable: BOOLEAN is True
58 -- Is there a current item that may be read?
59 -- (Answer: yes.)
60
61 writable: BOOLEAN is False
62 -- Is there a current item that may be written?
63 -- (Answer: no.)
64
65 feature -- Cursor movement
66
67 forth is
68 -- Move to next position.
69 do
70 index := index + 1
71 end
72
73 start is
74 -- Move to first position.
75 do
76 index := 1
77 end
78
79 feature {NONE} -- Inapplicable
80
81 extend (v: G) is
82 -- Add `v' at end.
83 do
84 end
85
86 finish is
87 -- Move to last position.
88 do
89 ensure then
90 failure: False
91 end
92
93 linear_representation: LINEAR [G] is
94 -- Representation as a linear structure
95 do
96 end
97
98 prune (v: G) is
99 -- Remove first occurrence of `v', if any.
100 do
101 end
102
103 put (v: G) is
104 -- Add `v' to the right of current position.
105 do
106 end
107
108 remove is
109 -- Remove item to the right of current position.
110 do
111 end
112
113 replace (v: G) is
114 -- Replace by `v' item at current position.
115 do
116 end
117
118 wipe_out is
119 -- Remove all items.
120 do
121 end
122
123 indexing
124
125 library: "[
126 EiffelBase: Library of reusable components for Eiffel.
127 ]"
128
129 status: "[
130 --| Copyright (c) 1993-2006 University of Southern California and contributors.
131 For ISE customers the original versions are an ISE product
132 covered by the ISE Eiffel license and support agreements.
133 ]"
134
135 license: "[
136 EiffelBase may now be used by anyone as FREE SOFTWARE to
137 develop any product, public-domain or commercial, without
138 payment to ISE, under the terms of the ISE Free Eiffel Library
139 License (IFELL) at http://eiffel.com/products/base/license.html.
140 ]"
141
142 source: "[
143 Interactive Software Engineering Inc.
144 ISE Building
145 360 Storke Road, Goleta, CA 93117 USA
146 Telephone 805-685-1006, Fax 805-685-6869
147 Electronic mail <info@eiffel.com>
148 Customer support http://support.eiffel.com
149 ]"
150
151 info: "[
152 For latest info see award-winning pages: http://eiffel.com
153 ]"
154
155 end -- class COUNTABLE_SEQUENCE
156
157

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23