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 void allocate
(
int $capacity
)
abstract public mixed first
(
void
)
abstract public mixed get
(
int $index
)
abstract public void insert
(
int $index
[,
mixed $...values
] )
abstract public string join
([
string $glue
] )
abstract public mixed last
(
void
)
abstract public Ds\Sequence merge
(
mixed $values
)
abstract public mixed pop
(
void
)
abstract public void push
([
mixed $...values
] )
abstract public mixed remove
(
int $index
)
abstract public void reverse
(
void
)
abstract public Ds\Sequence reversed
(
void
)
abstract public void rotate
(
int $rotations
)
abstract public void set
(
int $index
,
mixed $value
)
abstract public mixed shift
(
void
)
abstract public Ds\Sequence slice
(
int $index
[,
int $length
] )
abstract public number sum
(
void
)
}
Table of Contents
There are no user contributed notes for this page.