1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
7 <meta name=
"Generator" content=
"Cocoa HTML Writer">
8 <meta name=
"CocoaVersion" content=
"949.43">
9 <style type=
"text/css">
10 p
.p1
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
}
11 p
.p2
{margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica
; min-height: 14.0px}
12 p
.p3
{margin: 0.0px 0.0px 0.0px 57.0px; font: 12.0px Helvetica
}
13 p
.p4
{margin: 0.0px 0.0px 0.0px 57.0px; font: 12.0px Helvetica
; min-height: 14.0px}
14 p
.p5
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #ad140d}
15 p
.p6
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; min-height: 12.0px}
16 p
.p7
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #0000bf}
17 p
.p8
{margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco
; color: #000000}
18 span
.s1
{font: 18.0px Helvetica
}
19 span
.s2
{color: #002fe0}
20 span
.s3
{color: #0024f8}
21 span
.s4
{color: #000000}
22 span
.s5
{color: #007300}
23 span
.s6
{color: #606060}
24 span
.s7
{color: #bf0000}
25 span
.Apple-tab-span
{white-space:pre
}
29 <p class=
"p1"><span class=
"s1"><b>TwoWayIdentityDictionary
<span class=
"Apple-tab-span"> </span><span class=
"Apple-tab-span"> </span></b></span><b>associative collection mapping keys to values and back
</b></p>
30 <p class=
"p2"><br></p>
31 <p class=
"p2"><br></p>
32 <p class=
"p1"><b>Inherits from:
</b><a href=
"../Core/Object.html"><span class=
"s2"><b>Object
</b></span></a><b> :
</b><a href=
"Collection.html"><span class=
"s2"><b>Collection
</b></span></a><b><span class=
"Apple-converted-space"> </span></b></p>
33 <p class=
"p2"><br></p>
34 <p class=
"p1">Similar to
<a href=
"IdentityDictionary.html"><span class=
"s3">IdentityDictionary
</span></a>, but allows to go efficiently from element to key and back.
</p>
35 <p class=
"p1">The contents of a TwoWayIdentityDictionary are
<b>unordered
</b>.
<span class=
"Apple-converted-space"> </span>You must not depend on the order of items.
</p>
36 <p class=
"p2"><br></p>
37 <p class=
"p2"><br></p>
38 <p class=
"p1"><b>*getID(obj)
</b></p>
39 <p class=
"p3">find the key for a given object. If object is not element of the dictionary, it returns nil.
</p>
40 <p class=
"p4"><br></p>
41 <p class=
"p5">// example
</p>
42 <p class=
"p6"><br></p>
43 <p class=
"p7"><span class=
"s4">a =
</span>TwoWayIdentityDictionary
<span class=
"s4">.new;
</span></p>
44 <p class=
"p8">a.put(
<span class=
"s5">\test
</span>,
999);
</p>
45 <p class=
"p8">a.put([
<span class=
"s6">"some"</span>,
<span class=
"s6">"strings"</span>],
1200);
</p>
46 <p class=
"p8">a.at(
<span class=
"s5">\test
</span>);
</p>
47 <p class=
"p8">a.getID(
999);
</p>
48 <p class=
"p8">a.getID(
1200);
</p>
49 <p class=
"p8">a.getID(
888);
<span class=
"s7">// nil
</span></p>