public class RoleList extends ArrayList<Object>
modCount
Constructor and Description |
---|
RoleList()
构造一个空rolelist。
|
RoleList(int initialCapacity)
构建了一个具有指定的初始容量的空rolelist。
|
RoleList(List<Role> list)
构建了一个
RoleList 含有的
List 指定的元素,在它们的
List 的迭代器返回的顺序。
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index, Object element)
在列表中指定的位置上插入指定的元素。
|
void |
add(int index, Role role)
在指定的位置上插入指定的元素的角色。
|
boolean |
add(Object o)
将指定的元素列表的结束。
|
void |
add(Role role)
添加指定的列表的最后一个元素的角色。
|
boolean |
addAll(Collection<?> c)
追加指定集合的所有元素到这个列表的末尾,按他们的指定集合的迭代器返回。
|
boolean |
addAll(int index, Collection<?> c)
将指定集合中的所有元素插入到该列表中,从指定位置开始。
|
boolean |
addAll(int index, RoleList roleList)
将所有指定到这个列表的rolelist元素,从指定位置开始,在它们的迭代器指定的rolelist返回顺序。
|
boolean |
addAll(RoleList roleList)
在指定附加到列表的末尾的rolelist所有元素,在它们的迭代器指定的rolelist返回顺序。
|
List<Role> |
asList()
返回此列表的视图作为一个
List<Role> 。
|
Object |
set(int index, Object element)
用指定元素替换此列表中指定位置的元素。
|
void |
set(int index, Role role)
将指定的位置设置为指定的角色。
|
clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public RoleList()
public RoleList(int initialCapacity)
initialCapacity
初始容量
public RoleList(List<Role> list) throws IllegalArgumentException
RoleList
含有的
List
指定的元素,在它们的
List
的迭代器返回的顺序。的
RoleList
实例有110%的
List
大小指定的初始容量。
list
-定义新的
RoleList
初始内容的
List
。
IllegalArgumentException
-如果
list
参数
null
或者
list
参数包含任何非角色对象。
ArrayList.ArrayList(java.util.Collection)
public List<Role> asList()
List<Role>
。要返回的值的变化反映了改变原来的
RoleList
反之亦然。
List<Role>
其内容反映这
RoleList
内容。
如果这种方法被称为在一个给定的RoleList
实例,随后尝试添加一个对象实例这是一个不Role
将失败与IllegalArgumentException
。由于兼容性的原因,一RoleList
,这种方法从来没有所谓的不允许其他Role
s要添加对象。
IllegalArgumentException
-如果这
RoleList
包含一个元素,不是一个
Role
。
public void add(Role role) throws IllegalArgumentException
role
的作用是增加。
IllegalArgumentException
-如果角色是空的。
public void add(int index, Role role) throws IllegalArgumentException, IndexOutOfBoundsException
index
-在列表中的新的作用对象是要插入的位置。
role
-角色对象被插入。
IllegalArgumentException
-如果角色是空的。
IndexOutOfBoundsException
如果访问列表的外部指标。
public void set(int index, Role role) throws IllegalArgumentException, IndexOutOfBoundsException
index
-指定位置。
role
-价值的作用元件应设置。
IllegalArgumentException
-如果角色是空的。
IndexOutOfBoundsException
如果访问列表的外部指标。
public boolean addAll(RoleList roleList) throws IndexOutOfBoundsException
roleList
元素被插入到列表中(可以为空)
IndexOutOfBoundsException
如果访问列表的外部指标。
ArrayList.addAll(Collection)
public boolean addAll(int index, RoleList roleList) throws IllegalArgumentException, IndexOutOfBoundsException
index
位置,从rolelist指定插入的第一个元素。
roleList
元素被插入到列表中。
IllegalArgumentException
-如果角色是空的。
IndexOutOfBoundsException
如果访问列表的外部指标。
ArrayList.addAll(int, Collection)
public boolean add(Object o)
ArrayList
add
接口
Collection<Object>
add
接口
List<Object>
add
方法重写,继承类
ArrayList<Object>
o
元素附加到列表
Collection.add(E)
指定)
public void add(int index, Object element)
ArrayList
public boolean addAll(Collection<?> c)
ArrayList
addAll
接口
Collection<Object>
addAll
接口
List<Object>
addAll
方法重写,继承类
ArrayList<Object>
c
收集含有的元素被添加到列表
AbstractCollection.add(Object)
public boolean addAll(int index, Collection<?> c)
ArrayList
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.