<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>评论：List的问题</title>
	<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm</link>
	<description>解己之惑，解人之惑</description>
	<pubDate>Fri, 25 Jul 2008 09:59:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2934</link>
		<pubDate>Sat, 23 Feb 2008 12:25:29 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2934</guid>
					<description>我觉得sublist不仅可以只读性的使用
我在例子里（例子我发在论坛里，这里帖不下）就操纵了sublist的元素，重新设置某个元素的值，还remove了一个子元素，这些变化都反映到了原来的list中，但在原来的list里remove一个元素时就报了某种并发异常</description>
		<content:encoded><![CDATA[<p>我觉得sublist不仅可以只读性的使用<br />
我在例子里（例子我发在论坛里，这里帖不下）就操纵了sublist的元素，重新设置某个元素的值，还remove了一个子元素，这些变化都反映到了原来的list中，但在原来的list里remove一个元素时就报了某种并发异常
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：Cherami</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2933</link>
		<pubDate>Sat, 23 Feb 2008 03:56:20 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2933</guid>
					<description>哈哈，欢迎抢地盘啊。

这个问题确实很有意思，sublist只能只读性的使用。
因为是view，所以设置断点查看sublist的结果看到的还是list中的全部元素，只是使用
size之类的方法时才会返回正确的结果。</description>
		<content:encoded><![CDATA[<p>哈哈，欢迎抢地盘啊。</p>
<p>这个问题确实很有意思，sublist只能只读性的使用。<br />
因为是view，所以设置断点查看sublist的结果看到的还是list中的全部元素，只是使用<br />
size之类的方法时才会返回正确的结果。
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2930</link>
		<pubDate>Fri, 22 Feb 2008 15:39:06 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2930</guid>
					<description>我把那个例子发论坛里去了，有兴趣的可以去看看</description>
		<content:encoded><![CDATA[<p>我把那个例子发论坛里去了，有兴趣的可以去看看
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2928</link>
		<pubDate>Fri, 22 Feb 2008 15:27:17 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2928</guid>
					<description>老刘，你的地盘给我占领了 :em46:  :em46:  :em46:</description>
		<content:encoded><![CDATA[<p>老刘，你的地盘给我占领了 <img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em46.gif" alt=":em46:" />  <img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em46.gif" alt=":em46:" />  <img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em46.gif" alt=":em46:" />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2927</link>
		<pubDate>Fri, 22 Feb 2008 15:26:34 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2927</guid>
					<description>帖下JDK文档里的两句话
The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. 

第一段话说，非结构化的change使list和sublist互相影响，第二句话说，结构化change除非是发生在sublist上，如果是发生在list上，sublist的语义将是未定义的。我在list里删除一个元素时，直接报了并发异常。</description>
		<content:encoded><![CDATA[<p>帖下JDK文档里的两句话<br />
The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.</p>
<p>The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. </p>
<p>第一段话说，非结构化的change使list和sublist互相影响，第二句话说，结构化change除非是发生在sublist上，如果是发生在list上，sublist的语义将是未定义的。我在list里删除一个元素时，直接报了并发异常。
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2926</link>
		<pubDate>Fri, 22 Feb 2008 15:16:55 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2926</guid>
					<description>:em29:   :em29:   :em29: 
帖不上来

简要说下我的例子的运行结果吧，
从sublist中删除一个元素时，list中也没了
从list中删除一个元素时，直接报java.util.ConcurrentModificationException</description>
		<content:encoded><![CDATA[<p><img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em29.gif" alt=":em29:" />   <img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em29.gif" alt=":em29:" />   <img src="http://www.jiehoo.com/wp-content/plugins/emotions/images/em29.gif" alt=":em29:" /><br />
帖不上来</p>
<p>简要说下我的例子的运行结果吧，<br />
从sublist中删除一个元素时，list中也没了<br />
从list中删除一个元素时，直接报java.util.ConcurrentModificationException
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2925</link>
		<pubDate>Fri, 22 Feb 2008 15:09:53 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2925</guid>
					<description>我写了个小例子，如下：
import java.util.ArrayList;
import java.util.List;

class ListTest {
	public static void main(String[] args) 	{
		ArrayList al = new ArrayList(10);
		for (int i=0; i</description>
		<content:encoded><![CDATA[<p>我写了个小例子，如下：<br />
import java.util.ArrayList;<br />
import java.util.List;</p>
<p>class ListTest {<br />
	public static void main(String[] args) 	{<br />
		ArrayList al = new ArrayList(10);<br />
		for (int i=0; i
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2924</link>
		<pubDate>Fri, 22 Feb 2008 15:08:51 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2924</guid>
					<description>这个话题有意思，我也看了下JDK文档，应该就是和你说的是一个意思，只是一个view，所以对list本身进行修改了结构的操作时，会发生问题。</description>
		<content:encoded><![CDATA[<p>这个话题有意思，我也看了下JDK文档，应该就是和你说的是一个意思，只是一个view，所以对list本身进行修改了结构的操作时，会发生问题。
</p>
]]></content:encoded>
				</item>
	<item>
		<title>来自：wf</title>
		<link>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2923</link>
		<pubDate>Fri, 22 Feb 2008 15:05:04 +0000</pubDate>
		<guid>http://www.jiehoo.com/list%e7%9a%84%e9%97%ae%e9%a2%98.htm#comment-2923</guid>
					<description>^_^  老刘终于又写笔记了</description>
		<content:encoded><![CDATA[<p>^_^  老刘终于又写笔记了
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
