/[eiffelstudio]/FreeELKS/trunk/library/kernel/to_special.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/to_special.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91424 - (show annotations)
Tue Oct 26 18:39:32 2004 UTC (15 years, 3 months ago) by manus_eiffel
File size: 2152 byte(s)
Initial revision

1 indexing
2
3 description: "References to special objects, for direct access to arrays and strings"
4 status: "See notice at end of class"
5 date: "$Date$"
6 revision: "$Revision$"
7
8 class TO_SPECIAL [T]
9
10 create
11 make_area
12
13 feature -- Access
14
15 area: SPECIAL [T]
16 -- Special data zone
17
18 feature {NONE} -- Initialization
19
20 make_area (n: INTEGER) is
21 -- Creates a special object for `n' entries.
22 require
23 non_negative_argument: n >= 0
24 do
25 create area.make (n)
26 ensure
27 area_allocated: area /= Void and then area.count = n
28 end
29
30 feature -- Access
31
32 item, infix "@" (i: INTEGER): T is
33 -- Entry at index `i', if in index interval
34 require
35 valid_index: valid_index (i)
36 do
37 Result := area.item (i)
38 end
39
40 feature -- Status report
41
42 valid_index (i: INTEGER): BOOLEAN is
43 -- Is `i' within the bounds of Current?
44 do
45 Result := (0 <= i) and then (i < area.count)
46 end
47
48 feature -- Element change
49
50 put (v: T; i: INTEGER) is
51 -- Replace `i'-th entry, if in index interval, by `v'.
52 require
53 valid_index: valid_index (i)
54 do
55 area.put (v, i)
56 ensure
57 inserted: item (i) = v
58 end
59
60 feature {NONE} -- Element change
61
62 set_area (other: like area) is
63 -- Make `other' the new `area'
64 do
65 area := other
66 end
67
68 indexing
69
70 library: "[
71 EiffelBase: Library of reusable components for Eiffel.
72 ]"
73
74 status: "[
75 Copyright 1986-2001 Interactive Software Engineering (ISE).
76 For ISE customers the original versions are an ISE product
77 covered by the ISE Eiffel license and support agreements.
78 ]"
79
80 license: "[
81 EiffelBase may now be used by anyone as FREE SOFTWARE to
82 develop any product, public-domain or commercial, without
83 payment to ISE, under the terms of the ISE Free Eiffel Library
84 License (IFELL) at http://eiffel.com/products/base/license.html.
85 ]"
86
87 source: "[
88 Interactive Software Engineering Inc.
89 ISE Building
90 360 Storke Road, Goleta, CA 93117 USA
91 Telephone 805-685-1006, Fax 805-685-6869
92 Electronic mail <info@eiffel.com>
93 Customer support http://support.eiffel.com
94 ]"
95
96 info: "[
97 For latest info see award-winning pages: http://eiffel.com
98 ]"
99
100 end -- class TO_SPECIAL
101
102
103

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23