/** * {@inheritdoc} */ public function rank($item) : int { return $this->tree->rank($item); }
public function test_that_rank_returns_expected_value_for_key() { $tree = new RedBlackSearchTree(new ComparableComparator()); foreach ($this->getWeekDays() as $value => $key) { $tree->set($key, $value); } $this->assertSame(4, $tree->rank(WeekDay::THURSDAY())); }
/** * {@inheritdoc} */ public function rank($key) : int { return $this->tree->rank($key); }