1 | <?php |
||
23 | class Distance implements ValueObjectInterface, ComparableInterface |
||
|
|||
24 | { |
||
25 | /** |
||
26 | * @var DistanceUnit |
||
27 | */ |
||
28 | protected $unit; |
||
29 | |||
30 | /** |
||
31 | * @var \Cubiche\Domain\System\Real |
||
32 | */ |
||
33 | protected $value; |
||
34 | |||
35 | /** |
||
36 | * @param Coordinate $from |
||
37 | * @param Coordinate $to |
||
38 | * @param DistanceUnit $unit |
||
39 | * |
||
40 | * @return Distance |
||
41 | */ |
||
42 | public static function fromTo( |
||
49 | |||
50 | /** |
||
51 | * @param \Cubiche\Domain\System\Real $value |
||
52 | * @param DistanceUnit $unit |
||
53 | */ |
||
54 | public function __construct(Real $value, DistanceUnit $unit) |
||
59 | |||
60 | /** |
||
61 | * @return DistanceUnit |
||
62 | */ |
||
63 | public function unit() |
||
67 | |||
68 | /** |
||
69 | * @return \Cubiche\Domain\System\Real |
||
70 | */ |
||
71 | public function value() |
||
75 | |||
76 | /** |
||
77 | * @param DistanceUnit $unit |
||
78 | * |
||
79 | * @return Distance |
||
80 | */ |
||
81 | public function in(DistanceUnit $unit) |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function equals($other) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function compareTo($other) |
||
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function __toString() |
||
123 | } |
||
124 |