|
The Sequence interface
(バージョン情報なし。おそらく SVN 版にしか存在しないでしょう)
はじめに
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
)
}
目次
|
|
|