コード例 #1
0
ファイル: SortedSet.php プロジェクト: novuso/system
 /**
  * {@inheritdoc}
  */
 public function rank($item) : int
 {
     return $this->tree->rank($item);
 }
コード例 #2
0
 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()));
 }
コード例 #3
0
ファイル: SortedTable.php プロジェクト: novuso/system
 /**
  * {@inheritdoc}
  */
 public function rank($key) : int
 {
     return $this->tree->rank($key);
 }