This repository was archived by the owner on Mar 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcollections_27.html
More file actions
54 lines (54 loc) · 3.11 KB
/
collections_27.html
File metadata and controls
54 lines (54 loc) · 3.11 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 25 March 2009), see www.w3.org" />
<title>Scala 2.8 コレクション API -- 連結リスト</title>
<link rel="stylesheet" type="text/css" href="guide.css" />
</head>
<body dir="ltr">
<table width="100%" cellpadding="0" cellspacing="2">
<tr>
<td bgcolor="#99CCFF"><a href="collections_28.html"><img border="0"
alt="双方向リスト" src="next.png" /></a></td>
<td bgcolor="#99CCFF"><a href="collections_23.html"><img border="0"
alt="具象可変コレクションクラス" src="up.png" /></a></td>
<td bgcolor="#99CCFF"><a href="collections_26.html"><img border="0"
alt="文字列ビルダ" src="previous.png" /></a></td>
<td align="center" bgcolor="#99CCFF" width="100%"><b>連結リスト</b></td>
<td bgcolor="#99CCFF" align="center" class="tocref"><a href=
"collections_49.html">目次</a></td>
</tr>
</table>
<blockquote style=
"border-left: 1px solid gray; font-family: Century, Times, 'Times New Roman', 'MS Gothic', serif; padding-left: 1em;">
最新版は <a href="http://docs.scala-lang.org/ja/overviews/collections/concrete-mutable-collection-classes.html">Scala Documentation</a> に移行しました。
</blockquote>
<h2>連結リスト</h2>
<p>連結リスト (<a href=
"http://www.scala-lang.org/api/current/scala/collection/mutable/LinkedList.html"><tt>LinkedList</tt></a>)
は、<tt>next</tt> ポインタにより連結されたノードから成る可変列だ。多くの言語では空の連結リストを表すのに
<tt>null</tt> が選ばれるが、空の列も全ての列演算をサポートする必要があるため、Scala のコレクションでは
<tt>null</tt> は都合が悪い。特に、<tt>LinkedList.empty.isEmpty</tt> は
<tt>true</tt> を返すべきで、<tt>NullPointerException</tt> を発生させるべきではない。
代わりに、空の連結リストは <tt>next</tt>
フィールドがノード自身を指すという特殊な方法で表現されている。不変リスト同様、連結リストは順列通りに探索するのに適している。また、連結リストは要素や他の連結リストを簡単に挿入できるように実装されている。</p>
<p>続いては、<a href="collections_28.html">双方向リスト</a></p>
<hr />
<table width="100%" cellpadding="0" cellspacing="2">
<tr>
<td bgcolor="#99CCFF"><a href="collections_28.html"><img border="0"
alt="双方向リスト" src="next.png" /></a></td>
<td bgcolor="#99CCFF"><a href="collections_23.html"><img border="0"
alt="具象可変コレクションクラス" src="up.png" /></a></td>
<td bgcolor="#99CCFF"><a href="collections_26.html"><img border="0"
alt="文字列ビルダ" src="previous.png" /></a></td>
<td align="center" bgcolor="#99CCFF" width="100%"><b>連結リスト</b></td>
<td bgcolor="#99CCFF" align="center" class="tocref"><a href=
"collections_49.html">目次</a></td>
</tr>
</table>
</body>
</html>