* @author Tobias Nyholm */ interface Collection extends \IteratorAggregate, \Countable { /** * @return Location * * @throws CollectionIsEmpty */ public function first(): Location; /** * @return bool */ public function isEmpty(): bool; /** * @return Location[] */ public function slice(int $offset, int $length = null); /** * @return bool */ public function has(int $index): bool; /** * @return Location * * @throws OutOfBounds */ public function get(int $index): Location; /** * @return Location[] */ public function all(): array; }