자료구조 Queue 클래스
(사용 가능한 버전 정보가 없으며 Git에만 있을 수 있음)
소개
큐는 "선입선출" 또는 "FIFO" 컬렉션으로, 큐 맨 앞의 값에만 액세스를 허용하고 해당 순서대로 파괴적으로 반복합니다.
클래스 개요
class Ds\Queue implements Ds\Collection, ArrayAccess {
/* Constants */
const int MIN_CAPACITY = 8;
/* Methods */
public allocate(int $capacity): void
public capacity(): int
public clear(): void
public copy(): Ds\Queue
public isEmpty(): bool
public peek(): mixed
public pop(): mixed
public push(mixed ...$values): void
public toArray(): array
}
미리 정의된 상수
Ds\Queue::MIN_CAPACITY
변경 로그
버전 | 설명 |
---|---|
PECL ds 1.3.0 | 클래스는 이제 ArrayAccess를 구현합니다. |
목차
- Ds\Queue::allocate — Allocates enough memory for a required capacity
- Ds\Queue::capacity — Returns the current capacity
- Ds\Queue::clear — Removes all values
- Ds\Queue::__construct — Creates a new instance
- Ds\Queue::copy — Returns a shallow copy of the queue
- Ds\Queue::count — Returns the number of values in the queue
- Ds\Queue::isEmpty — Returns whether the queue is empty
- Ds\Queue::jsonSerialize — Returns a representation that can be converted to JSON
- Ds\Queue::peek — Returns the value at the front of the queue
- Ds\Queue::pop — Removes and returns the value at the front of the queue
- Ds\Queue::push — Pushes values into the queue
- Ds\Queue::toArray — Converts the queue to an array