xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Public 成员函数 | 包函数
Vector<_V> 模板类 参考

vector容器 更多...

Public 成员函数

包函数

详细描述

vector容器

在文件 Vector.xcs7 行定义.

构造及析构函数说明

◆ Vector() [1/3]

int Vector ( )

◆ Vector() [2/3]

int Vector ( int  )

◆ Vector() [3/3]

Vector ( int  presize)
package

构造

参数
presize预备大小

成员函数说明

◆ add() [1/2]

void add ( _V  val)
package

插入数据

返回

◆ add() [2/2]

void add ( )

◆ addAll() [1/2]

void addAll ( _V []  val)
package

插入数据数组

返回

◆ addAll() [2/2]

void addAll ( [])

◆ clear() [1/2]

void clear ( )

◆ clear() [2/2]

void clear ( )
package

清空容器

返回

◆ finalize() [1/2]

void finalize ( )

◆ finalize() [2/2]

void finalize ( )
package

析构处理 @caution 注意 重写finalize时必须使用 super.finalize(); 否则会造成泄露

返回

◆ get() [1/2]

_V get ( int  pos)
package

获取指定位置的对象

参数
pos位置序号

◆ get() [2/2]

T get ( int  ) throws IllegalArgumentException

◆ insert() [1/2]

void insert ( int  pos,
_V  val 
)
package

在指定位置插入数据

参数
pos位置序号
返回

◆ insert() [2/2]

void insert ( int  ,
  T 
) throws IndexOutOfBoundsException

◆ operator []()

T operator [] ( int  ,
  T 
) throws IndexOutOfBoundsException, IllegalArgumentException

◆ operator[]()

T operator[] ( int  ) throws IndexOutOfBoundsException, IllegalArgumentException

◆ remove() [1/2]

void remove ( int  pos)
package

删除指定位置的数据

参数
pos位置序号
返回

◆ remove() [2/2]

void remove ( int  ) throws IllegalArgumentException

◆ removeRange() [1/2]

void removeRange ( int  pos,
int  size 
)
package

从指定位置删除指定长度的数据

参数
pos位置序号
size要删除的长度
返回

◆ removeRange() [2/2]

void removeRange ( int  ,
int   
) throws IllegalArgumentException

◆ set()

void set ( int  ,
  T 
) throws IndexOutOfBoundsException, IllegalArgumentException

◆ size() [1/2]

int size ( )

◆ size() [2/2]

int size ( )
package

获取容器内数据数量

返回
长度

◆ toArray() [1/2]

_V [] toArray ( _V []  array)
package

将容器内容转到数组

参数
array类型标志 用 new _V[0] 即可
返回

◆ toArray() [2/2]

T [] toArray ( []) throws IllegalArgumentException