Completed
Push — master ( c60dd0...055fc0 )
by Basarab
03:24
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;
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 39
    public function __construct(KDTreeInterface $tree)
22
    {
23 39
        $this->tree = $tree;
24 39
        $this->dimensions = $tree->getDimensionCount();
25 39
    }
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