1 | <?php |
||
12 | class Range |
||
13 | { |
||
14 | /** |
||
15 | * @var \JAAulde\IP\V4\Address The first address in the range being represented |
||
16 | */ |
||
17 | protected $firstAddress; |
||
18 | /** |
||
19 | * @var \JAAulde\IP\V4\Address The last address in the range being represented |
||
20 | */ |
||
21 | protected $lastAddress; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * |
||
26 | * @param \JAAulde\IP\V4\Address $firstAddress The first address of the range being created |
||
27 | * @param \JAAulde\IP\V4\Address $lastAddress The last address of the range being created |
||
28 | * |
||
29 | * @throws Exception |
||
30 | */ |
||
31 | public function __construct(Address $firstAddress, Address $lastAddress) |
||
40 | |||
41 | /** |
||
42 | * Determine if a given address is contained within the range. |
||
43 | * |
||
44 | * @param \JAAulde\IP\V4\Address $address The address we want to know about |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function contains(Address $address) |
||
54 | |||
55 | /** |
||
56 | * Retrieve the first address in the range. |
||
57 | * |
||
58 | * @return \JAAulde\IP\V4\Address |
||
59 | */ |
||
60 | public function getFirstAddress() |
||
64 | |||
65 | /** |
||
66 | * Retrieve the last address in the range. |
||
67 | * |
||
68 | * @return \JAAulde\IP\V4\Address |
||
69 | */ |
||
70 | public function getLastAddress() |
||
74 | } |
||
75 |