Skip to content

Latest commit

 

History

History
283 lines (92 loc) · 1.72 KB

PQueue.md

File metadata and controls

283 lines (92 loc) · 1.72 KB

PQueue

Simple priority queue.

  • Full name: \ColorThief\PQueue

Properties

contents

private array $contents

sorted

private bool $sorted

comparator

private callable $comparator

Methods

__construct

public __construct(callable $comparator): mixed

Parameters:

Parameter Type Description
$comparator callable

sort

private sort(): void

push

public push(mixed $object): void

Parameters:

Parameter Type Description
$object mixed

peek

public peek(?int $index = null): mixed

Parameters:

Parameter Type Description
$index ?int

pop

public pop(): mixed|null

size

public size(): int

map

public map(callable $function, bool $sorted = true): array

Parameters:

Parameter Type Description
$function callable
$sorted bool

setComparator

public setComparator(callable $function): void

Parameters:

Parameter Type Description
$function callable

getContent

public getContent(bool $sorted = true): \ColorThief\T[]

Parameters:

Parameter Type Description
$sorted bool