1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 2.0">
<title>Class DS_SEARCHABLE</title>
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="100%">
<tr>
<td><font size="6"><strong>Class DS_SEARCHABLE</strong></font></td>
<td align="right"><a href="ds_reverse_comparator.html"><img
src="../../image/previous.gif" alt="Previous" border="0"
width="40" height="40"></a><a href="ds_set.html"><img
src="../../image/next.gif" alt="Next" border="0"
width="40" height="40"></a></td>
</tr>
</table>
<hr size="1">
<pre><font color="#000080"><em><strong>indexing</strong></em></font></pre>
<blockquote>
<pre><em>description</em>:
<font color="#800000"><em> "Data structures that can be searched"
</em></font><em>library: </em><font color="#800000"><em>"Gobo Eiffel Structure Library"
</em></font><em>author: </em><font color="#800000"><em>"Eric Bezault <</em></font><a
href="mailto:ericb@gobosoft.com"><font color="#800000"><em>ericb@gobosoft.com</em></font></a><font
color="#800000"><em>>"
</em></font><em>copyright: </em><font color="#800000"><em>"Copyright (c) 1999-2001, Eric Bezault and others"
</em></font><em>license: </em><font color="#800000"><em> "Eiffel Forum Freeware License v1 (see forum.txt)"</em></font></pre>
</blockquote>
<pre><font color="#000080"><em><strong>deferred class interface</strong></em></font></pre>
<blockquote>
<pre><em>DS_SEARCHABLE </em>[<em>G</em>]</pre>
</blockquote>
<pre><font color="#000080"><em><strong>inherit</strong></em></font></pre>
<blockquote>
<pre><a href="ds_container.html"><em>DS_CONTAINER</em></a><em> </em>[<em>G</em>]</pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><em> </em>{<em>NONE</em>}<font
color="#008000"> -- Initialization</font></pre>
<blockquote>
<pre><a name="make_default"><em>make_default</em></a><em>
</em><font color="#008000"> -- Create an empty container.</font><em>
</em><font color="#008000"> -- (From </font><a
href="ds_container.html#make_default"><font color="#008000"><em>DS_CONTAINER</em></font></a><font
color="#008000">.)</font><em>
</em><font color="#000080"><em><strong> deferred</strong></em></font><em>
</em><font color="#000080"><em><strong>ensure</strong></em></font><em>
empty</em>:<em> </em><a href="#is_empty"><em>is_empty</em></a></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Access</font></pre>
<blockquote>
<pre><a name="equality_tester"><em>equality_tester</em></a>:<em> </em><a
href="ds_equality_tester.html"><em>DS_EQUALITY_TESTER</em></a><em> </em>[<em>G</em>]<em>
</em><font color="#008000">-- Equality tester;
-- A void equality tester means that `='
-- will be used as comparison criterion.</font></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Measurement</font></pre>
<blockquote>
<pre><a name="count"><em>count</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><font
color="#000080"><em><strong>
</strong></em></font><font color="#008000">-- Number of items in container
-- (From </font><a href="ds_container.html#count"><font
color="#008000"><em>DS_CONTAINER</em></font></a><font
color="#008000">.)</font><font color="#000080"><em><strong>
deferred</strong></em></font></pre>
<pre><a name="occurrences"><em>occurrences</em></a><em> </em>(<em>v</em>:<em> G</em>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">-- Number of times </font><em>v</em><font
color="#008000"> appears in container
-- (Use </font><a href="#equality_tester"><em>equality_tester</em></a><font
color="#008000">'s comparison criterion
-- if not void, use `=' criterion otherwise.)</font><em>
</em><font color="#000080"><em><strong>deferred
ensure</strong></em></font><em>
positive</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>>=<em> </em><font
color="#808000"><em>0</em></font><em>
has</em>:<em> </em><a href="#has"><em>has</em></a><em> </em>(<em>v</em>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em><font
color="#008080"><em>Result</em></font><em> </em>>=<em> </em><font
color="#808000"><em>1</em></font></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Status report</font></pre>
<blockquote>
<pre><a name="has"><em>has</em></a><em> </em>(<em>v</em>:<em> G</em>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000">-- Does container include </font><em>v</em><font
color="#008000">?
-- (Use </font><a href="#equality_tester"><em>equality_tester</em></a><font
color="#008000">'s comparison criterion
-- if not void, use `=' criterion otherwise.)</font><em>
</em><font color="#000080"><em><strong>deferred
ensure</strong></em></font><em>
not_empty</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies not</strong></em></font><em> </em><a
href="#is_empty"><em>is_empty</em></a></pre>
<pre><a name="same_items"><em>same_items</em></a><em> </em>(<em>v</em>,<em> u</em>:<em> G</em>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000"> -- Are </font><em>v</em><font
color="#008000"> and </font><em>u</em><font color="#008000"> considered equal?
-- (Use </font><a href="#equality_tester"><em>equality_tester</em></a><font
color="#008000">'s comparison criterion
-- if not void, use `=' criterion otherwise.)</font></pre>
<pre><a name="same_equality_tester"><em>same_equality_tester</em></a><em> </em>(<em>other</em>:<em> </em><a
href="ds_searchable.html"><em>DS_SEARCHABLE</em></a><em> </em>[<em>G</em>]):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000"> -- Does container use the same comparison
-- criterion as </font><em>other</em><font
color="#008000">?</font><em>
</em><font color="#000080"><em><strong>require</strong></em></font><em>
other_not_void</em>:<em> other </em>/=<em> </em><font
color="#008080"><em>Void</em></font></pre>
<pre><a name="equality_tester_settable"><em>equality_tester_settable</em></a><em> </em>(<em>a_tester</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#equality_tester"><em>equality_tester</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000"> -- Can </font><a
href="#set_equality_tester"><em>set_equality_tester</em></a><font
color="#008000"> be called with </font><em>a_tester</em><font
color="#008000">
-- as argument in current state of container?
-- (Default answer: True.)</font></pre>
<pre><a name="is_empty"><em>is_empty</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><font
color="#000080"><em><strong>
</strong></em></font><font color="#008000"> -- Is container empty?
-- (From </font><a href="ds_container.html#is_empty"><font
color="#008000"><em>DS_CONTAINER</em></font></a><font
color="#008000">.)</font></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Comparison</font></pre>
<blockquote>
<pre><a name="is_equal"><em>is_equal</em></a><em> </em>(<em>other</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>)</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000">-- Is current container equal to </font><em>other</em><font
color="#008000">?</font><em>
</em><font color="#008000">-- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#is_equal"><font
color="#008000"><em>GENERAL</em></font></a><font color="#008000">.)</font><em>
</em><font color="#000080"><em><strong>require</strong></em></font><em>
other_not_void</em>:<em> other </em>/=<em> </em><font
color="#008080"><em>Void</em></font><em>
</em><font color="#000080"><em><strong>deferred</strong></em></font><em>
</em><font color="#000080"><em><strong>ensure</strong></em></font><em>
consistent</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#standard_is_equal"><em>standard_is_equal</em></a><em> </em>(<em>other</em>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em><font
color="#008080"><em>Result</em></font><em>
same_type</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#same_type"><em>same_type</em></a><em> </em>(<em>other</em>)<em>
symmetric</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> other</em>.<a
href="#is_equal"><em>is_equal</em></a><em> </em>(<font
color="#008080"><em>Current</em></font>)<em>
same_count</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> count </em>=<em> other</em>.<a
href="#count"><em>count</em></a></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font> <font
color="#008000">-- Duplication</font></pre>
<blockquote>
<pre><a name="copy"><em>copy</em></a><em> </em>(<em>other</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font>)<em>
</em><font color="#008000">-- Copy </font><em>other</em><font
color="#008000"> to current container.
-- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#copy"><font
color="#008000"><em>GENERAL</em></font></a><font color="#008000">.)</font><em>
</em><font color="#000080"><em><strong>require</strong></em></font><em>
other_not_void</em>:<em> other </em>/= <font
color="#008080"><em>Void</em></font><em>
type_identity</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#same_type"><em>same_type</em></a><em> </em>(<em>other</em>)<em>
</em><font color="#000080"><em><strong>deferred
ensure</strong></em></font><em>
is_equal</em>:<em> </em><a href="#is_equal"><em>is_equal</em></a><em> </em>(<em>other</em>)</pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Setting</font></pre>
<blockquote>
<pre><a name="set_equality_tester"><em>set_equality_tester</em></a><em> </em>(<em>a_tester</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#equality_tester"><em>equality_tester</em></a>)<em>
</em><font color="#008000">-- Set </font><a
href="#equality_tester"><em>equality_tester</em></a><font
color="#008000"> to </font><em>a_tester</em><font color="#008000">.
-- A void equality tester means that `='
-- will be used as comparison criterion.</font><em>
</em><font color="#000080"><em><strong> require</strong></em></font><em>
equality_tester_settable</em>:<em> </em><a
href="#equality_tester_settable"><em>equality_tester_settable</em></a><em> </em>(<em>a_tester</em>)<em>
</em><font color="#000080"><em><strong>ensure</strong></em></font><em>
equality_tester_set</em>:<em> </em><a
href="#equality_tester"><em>equality_tester</em></a><em> </em>= <em>a_tester</em></pre>
</blockquote>
<pre><font color="#000080"><em><strong>feature</strong></em></font><font
color="#008000"> -- Removal</font></pre>
<blockquote>
<pre><a name="wipe_out"><em>wipe_out</em></a><em>
</em><font color="#008000">-- Remove all items from container.
-- (From </font><a href="ds_container.html#wipe_out"><font
color="#008000"><em>DS_CONTAINER</em></font></a><font
color="#008000">.)</font><em>
</em><font color="#000080"><em><strong>deferred
ensure</strong></em></font><em>
wiped_out</em>:<em> </em><a href="#is_empty"><em>is_empty</em></a></pre>
</blockquote>
<pre><a name="invariant"><font color="#000080"><em><strong>invariant</strong></em></font></a></pre>
<blockquote>
<pre><em>positive_count</em>:<em> </em><a href="#count"><em>count</em></a><em> </em>>=<em> </em><font
color="#808000"><em>0</em></font><em>
empty_definition</em>:<em> </em><a href="#is_empty"><em>is_empty</em></a><em> </em>= (<a
href="#count"><em>count</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font>)
<font color="#008000">-- (From </font><a
href="ds_container.html#invariant"><font color="#008000"><em>DS_CONTAINER</em></font></a><font
color="#008000">.)</font></pre>
</blockquote>
<pre><font color="#000080"><em><strong>end</strong></em></font><font
color="#008000"> -- class DS_SEARCHABLE</font></pre>
<hr size="1">
<table border="0" width="100%">
<tr>
<td><address>
<font size="2"><b>Copyright 1999-2001</b></font><font
size="1"><b>, </b></font><font size="2"><strong>Eric
Bezault</strong></font><strong> </strong><font
size="2"><br>
<strong>mailto:</strong></font><a
href="mailto:ericb@gobosoft.com"><font size="2">ericb@gobosoft.com</font></a><font
size="2"><br>
<strong>http:</strong></font><a
href="http://www.gobosoft.com"><font size="2">//www.gobosoft.com</font></a><font
size="2"><br>
<strong>Last Updated:</strong> 31 March 2001</font><br>
<!--webbot bot="PurpleText"
preview="
$Date: 2001/04/06 16:12:47 $
$Revision: 1.4 $"
-->
</address>
</td>
<td align="right" valign="top"><a
href="http://www.gobosoft.com"><img
src="../../image/home.gif" alt="Home" border="0"
width="40" height="40"></a><a href="index.html"><img
src="../../image/toc.gif" alt="Toc" border="0" width="40"
height="40"></a><a href="ds_reverse_comparator.html"><img
src="../../image/previous.gif" alt="Previous" border="0"
width="40" height="40"></a><a href="ds_set.html"><img
src="../../image/next.gif" alt="Next" border="0"
width="40" height="40"></a></td>
</tr>
</table>
</body>
</html>
|