The Sequence interface
(No version information available, might only be in Git)
简介
A Sequence describes the behaviour of values arranged in a single, linear dimension.
Some languages refer to this as a "List". It's similar to an array that uses
incremental integer keys, with the exception of a few characteristics:
- Values will always be indexed as [0, 1, 2, ..., size - 1].
- Only allowed to access values by index in the range [0, size - 1].
Use cases:
接口摘要
Ds\Sequence
implements Ds\Collection
{
abstract public allocate
(
int $capacity
) :
void
abstract public get
(
int $index
) :
mixed
abstract public insert
(
int $index
[,
mixed $...values
] ) :
void
abstract public join
([
string $glue
] ) :
string
abstract public map
(
callable $callback
) :
Ds\Sequence
abstract public merge
(
mixed $values
) :
Ds\Sequence
abstract public push
([
mixed $...values
] ) :
void
abstract public reverse
(
void
) :
void
abstract public reversed
(
void
) :
Ds\Sequence
abstract public rotate
(
int $rotations
) :
void
abstract public set
(
int $index
,
mixed $value
) :
void
abstract public slice
(
int $index
[,
int $length
] ) :
Ds\Sequence
}
Table of Contents
User Contributed Notes
There are no user contributed notes for this page.