\ArrayList

A dynamics array object. Implements the System.Collections.IList interface using an array whose size is dynamically increased as required.To browse the .NET Framework source code for this type, see the Reference Source.

对集合类型的基本抽象

Summary

Methods
Properties
Constants
__get()
__set()
__construct()
__toString()
GetJson()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
SaveTo()
ToArray()
Add()
AddRange()
RemoveLast()
Remove()
RemoveAt()
InsertAt()
No public properties found
No constants found
No protected methods found
$__data
N/A
No private methods found
No private properties found
N/A

Properties

$__data

$__data : array

数组是序列对象的最基本数据存储结构对象

Type

array

Methods

__get()

__get(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__construct()

__construct(  $source = null) 

使用默认的构造函数

Parameters

$source

__toString()

__toString() 

这个函数定义当前的这个集合对象与字符串函数交互的默认行为

GetJson()

GetJson() 

将当前的这个字典对象序列化为json字符串,以返回给客户端浏览器

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

SaveTo()

SaveTo(string  $path, array  $project = null, string  $encoding = "utf8") : boolean

Save this data collection as csv file

Parameters

string $path

The csv file path for save this collection object.

array $project

The csv file header mapping.

string $encoding

The text file content encoding, by default is utf8 encoding.

Returns

boolean

ToArray()

ToArray() : array

Copies the elements of the ``System.Collections.ArrayList`` to a new System.Object array.

Returns

array —

An System.Object array containing copies of the elements of the System.Collections.ArrayList.

Add()

Add(\mix  $obj) : integer

Adds an object to the end of the System.Collections.ArrayList.

Parameters

\mix $obj

The System.Object to be added to the end of the System.Collections.ArrayList. The value can be null.

Returns

integer —

The System.Collections.ArrayList index at which the value has been added.

AddRange()

AddRange(array  $array) 

Adds the elements of an System.Collections.ICollection to the end of the System.Collections.ArrayList.

Parameters

array $array

The System.Collections.ICollection whose elements should be added to the end of the System.Collections.ArrayList. The collection itself cannot be null, but it can contain elements that are null.

RemoveLast()

RemoveLast() 

pops and returns the last value of the list, shortening the list by one element.

Remove()

Remove(  $obj) 

Parameters

$obj

RemoveAt()

RemoveAt(\int  $index) 

Parameters

\int $index

InsertAt()

InsertAt(\int  $index,   $obj) 

Parameters

\int $index
$obj