WindList __construct(
[array|WindList
$data = array()], [boolean
$readOnly = false]
)
|
|
WindList 实现有三种类别:只读、固定大小、可变大小。
无法修改只读 WindList。 固定大小的 WindList 不允许添加或移除元素,但允许修改现有元素。 可变大小的 WindList 允许添加、移除和修改元素。
Parameters:
boolean |
$readOnly: |
是否只读 |
array|WindList |
$data: |
固定长度,如果指定了$data,那么这个WindList集合的长度是固定的,只许修改 |
API Tags:
boolean add(
mixed
$value
)
|
|
向 WindList 中添加项。
Parameters:
API Tags:
boolean contain(
mixed
$value
)
|
|
判断WindList中是否包含指定项
Parameters:
API Tags:
boolean containAt(
int
$index
)
|
|
判断WindList中是否包含指定的索引
Parameters:
API Tags:
API Tags:
Implementation of:
- Countable::count
boolean getIsFixedSize(
)
|
|
取得集合是否是固定大小
API Tags:
取得集合的迭代器
API Tags:
Implementation of:
- IteratorAggregate::getIterator
int indexOf(
mixed
$value
)
|
|
返回指定项的索引,返回-1表向没有指定项
Parameters:
API Tags:
boolean insertAt(
int
$index, mixed
$value
)
|
|
在 WindList 中的指定索引处插入项。
Parameters:
int |
$index: |
|
mixed |
$value: |
|
API Tags:
mixed itemAt(
int
$index
)
|
|
取得指定索引的项
Parameters:
API Tags:
boolean mergeFromArray(
array
$array
)
|
|
将数组中的值合并到WindList
Parameters:
API Tags:
将WindList集合合并到WindList
Parameters:
API Tags:
boolean modify(
int
$index, mixed
$value
)
|
|
修改WindList中指定索引的项
Parameters:
int |
$index: |
指定索引 |
mixed |
$value: |
要修改的项 |
API Tags:
void offsetExists(
int
$offset
)
|
|
Parameters:
API Tags:
Implementation of:
- ArrayAccess::offsetExists
void offsetGet(
int
$offset
)
|
|
Parameters:
API Tags:
Implementation of:
- ArrayAccess::offsetGet
void offsetSet(
int
$offset, mixed
$value
)
|
|
Parameters:
int |
$offset: |
|
mixed |
$value: |
|
API Tags:
Implementation of:
- ArrayAccess::offsetSet
void offsetUnset(
int
$offset
)
|
|
Parameters:
API Tags:
Implementation of:
- ArrayAccess::offsetUnset
boolean remove(
mixed
$value
)
|
|
从WindList中移除指定的项
Parameters:
API Tags:
mixed removeAt(
int
$index, [
$force = false]
)
|
|
从WindList中移除指定索引的项
Parameters:
API Tags: