Completed
Push — master ( fa9ce0...d51bbf )
by Basarab
06:08
created

SearchAbstract::search()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace Hexogen\KDTree\Interfaces;
4
5
abstract class SearchAbstract
6
{
7
    /**
8
     * @var KDTreeInterface
9
     */
10
    protected $tree;
11
12
    /**
13
     * @var int
14
     */
15
    protected $dimensions;
16
17
    /**
18
     * SearchAbstract constructor.
19
     * @param KDTreeInterface $tree
20
     */
21 42
    public function __construct(KDTreeInterface $tree)
22
    {
23 42
        $this->tree = $tree;
24 42
        $this->dimensions = $tree->getDimensionCount();
25 42
    }
26
27
    /**
28
     * Search items it the tree by given algorithm
29
     *
30
     * @param PointInterface $point
31
     * @param int $resultLength
32
     * @return array
33
     */
34
    abstract public function search(PointInterface $point, int $resultLength = 1) : array;
35
}
36