1 | <?php |
||
8 | class Set implements Countable, IteratorAggregate |
||
9 | { |
||
10 | /** @var array */ |
||
11 | protected $items; |
||
12 | |||
13 | /** |
||
14 | * Set constructor. |
||
15 | * @param ...$items |
||
16 | */ |
||
17 | public function __construct(...$items) |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function count() |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function getIterator() |
||
37 | |||
38 | /** |
||
39 | * @param mixed $item |
||
40 | */ |
||
41 | public function insert($item) |
||
47 | |||
48 | /** |
||
49 | * @param mixed $item |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function has($item) |
||
56 | |||
57 | /** |
||
58 | * @param \Wandu\Compiler\Math\Set $other |
||
59 | * @return \Wandu\Compiler\Math\Set |
||
60 | */ |
||
61 | public function ringSum(Set $other) |
||
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | public function toArray() |
||
82 | |||
83 | /** |
||
84 | * @param \Wandu\Compiler\Math\Set $other |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function equal(Set $other) |
||
101 | |||
102 | /** |
||
103 | * @param \Wandu\Compiler\Math\Set $other |
||
104 | */ |
||
105 | public function union(Set $other) |
||
109 | |||
110 | protected function arrayUnique(array $array) |
||
120 | } |
||
121 |