java.util.List翻译
2008-02-23 09:33:40来源:互联网 阅读 ()
- Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.) 向列表的指定位置插入指定集合的所有元素(可选操作)。当前位置的元素(若有) 和所有后续元素右移(下标加1)。列表中新元素的出现顺序为指定集合迭代其返回的 顺序。如果在该操作过程中指定集合被修改,操作行为无法确定。 (注意,这只有在指定集合为当前列表且非空的情况下才会发生。)
- Parameters:
index
- index at which to insert first element from the specified collection. 插入指定集合中的一个元素的下标。c
- elements to be inserted into this list. 被插入列表的元素。- Returns:
- true if this list changed as a result of the call. 如果调用的结果改变了列表,返回true。
- Throws:
UnsupportedOperationException
- if the addAll method is not supported by this list. 如果列表不支持addAll方法时抛出。ClassCastException
- if the class of one of elements of the specified collection prevents it from being added to this list. 如果指定集合的元素类型阻止其加入列表时抛出。NullPointerException
- if the specified collection contains one or more null elements and this list does not support null elements, or if the specified collection is null. 如果指定集合包含一个或多个null元素而列表不支持null元素或者指定集合为null时抛出。IllegalArgumentException
- if some aspect of one of elements of the specified collection prevents it from being added to this list. 如果指定集合的某个元素的某些方面不允许它加入当前列表则抛出。IndexOutOfBoundsException
- if the index is out of range (index < 0 || index > size()). 如果下标超出(index < 0 || index > size())的范围时抛出。
Iterator i = list.iterator(); while (i.hasNext()) { Object obj = i.next(); hashCode = 31*hashCode (obj==null ? 0 : obj.hashCode()); } This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object.hashCode. 这将确保对于两个列表list11和list2,list1.equals(list2) 意味着list1.hashCode()==list2.hashCode(),遵循 Object.hashCode方法的一般约定。
- Specified by:
hashCode
in interfaceCollection
- Overrides:
hashCode
in classObject
- Returns:
- the hash code value for this list.
- See Also:
Object.hashCode()
,Object.equals(Object)
,equals(Object)
Object element)
- Replaces the element at the specified position in this list with the specified element (optional operation). 以指定元素替换列表指定位置的元素(可选操作)。
- Parameters:
index
- index of element to replace. 要替换的元素下标。element
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash