Data Structures: 3rd Amendment (#856)

This commit is contained in:
dguhl 2020-06-26 21:39:18 +02:00 committed by GitHub
parent 16a0de7429
commit 0aef49e719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 2 deletions

View File

@ -436,6 +436,8 @@ namespace Ds {
* <h3>Weaknesses
* <li>shift(), unshift(), insert() and remove() are all O(n).
*
* @link https://www.php.net/manual/en/class.ds-vector.php
*
* @package Ds
*/
class Vector implements Sequence
@ -443,6 +445,16 @@ namespace Ds {
const MIN_CAPACITY = 10;
/**
* Creates a new instance, using either a traversable object or an array for the initial values.
*
* @param array|Traversable $values
*/
public function __construct($values = null)
{
}
/**
* Ensures that enough memory is allocated for a required capacity.
* This removes the need to reallocate the internal as values are added.
@ -1863,6 +1875,16 @@ namespace Ds {
*/
class Pair implements JsonSerializable
{
/**
* @var mixed
*/
public $key;
/**
* @var mixed
*/
public $value;
/**
* Creates a new instance using a given key and value.
*
@ -2001,7 +2023,7 @@ namespace Ds {
*
* <p><b>Caution:</b> All comparisons are strict (type and value).
*
* @param mixed ...$values Values to check.
* @param mixed ...$values Values to check.
*
* @return bool
*
@ -2326,7 +2348,7 @@ namespace Ds {
*
* @link https://www.php.net/manual/en/ds-set.union.php
*
* @param Set $set The other set, to combine with the current instance.
* @param Set $set The other set, to combine with the current instance.
*
* @return Set A new set containing all the values of the current
* instance as well as another set.
@ -2731,6 +2753,16 @@ namespace Ds {
{
}
/**
* Pushes a value with a given priority into the queue.
*
* @param mixed $value
* @param int $priority
*/
public function push($value, int $priority)
{
}
/**
* Converts the collection to an array.
* <p><b>Note:</b> Casting to an array is not supported yet.