Retutrns the priority of an item at a particular flattened index.
public priorityAt ( $index, $withindex = false ) : numeric | array | ||
return | numeric | array | the priority of the item in the list, false if not found. if withindex is true, an array is returned of [0 => $priority, 1 => $priorityIndex, 2 => flattenedIndex, 'priority' => $priority, 'index' => $priorityIndex, 'absindex' => flattenedIndex] |
public function testInsertAtTPriorityList() { $plist = new TPriorityList($this->plist); $this->assertNull($plist->insertAt(0, $this->pitem3)); $this->assertEquals(-10000000, $plist->priorityAt(0)); try { $plist->insertAt(5, $this->pitem3); $this->fail('exception not raised when adding item at an out-of-range index'); } catch (TInvalidDataValueException $e) { } $this->assertEquals(100, $plist->priorityAt(4)); }