|
4 | 4 | [java.time.chrono Chronology])) |
5 | 5 |
|
6 | 6 | (defprotocol Amount |
7 | | - (^:redef zero? [a] |
| 7 | + (zero? [a] |
8 | 8 | "True if the amount is zero") |
9 | | - (^:redef negative? [a] |
| 9 | + (negative? [a] |
10 | 10 | "True if the amount is negative") |
11 | | - (^:redef negate [a] |
| 11 | + (negate [a] |
12 | 12 | "Negates a temporal amount: |
13 | 13 |
|
14 | 14 | (negate (negate x)) == x") |
15 | | - (^:redef abs [a] |
| 15 | + (abs [a] |
16 | 16 | "Returns the absolute value of a temporal amount: |
17 | 17 |
|
18 | 18 | (abs (negate x)) == (abs x)")) |
19 | 19 |
|
20 | 20 | (defprotocol Supporting |
21 | | - (^:redef supports? [o p] |
| 21 | + (supports? [o p] |
22 | 22 | "True if the `o` entity supports the `p` property")) |
23 | 23 |
|
24 | 24 | (defprotocol HasChronology |
25 | | - (^:redef ^java.time.chrono.Chronology chronology [o] |
| 25 | + (^java.time.chrono.Chronology chronology [o] |
26 | 26 | "The `Chronology` of the entity")) |
27 | 27 |
|
28 | 28 | (defprotocol HasFields |
29 | | - (^:redef fields [o] |
| 29 | + (fields [o] |
30 | 30 | "Fields present in this temporal entity") |
31 | | - (^:redef field* [o k] |
| 31 | + (field* [o k] |
32 | 32 | "Internal use")) |
33 | 33 |
|
34 | 34 | (defprotocol HasUnits |
35 | | - (^:redef units [o] |
| 35 | + (units [o] |
36 | 36 | "Units present in this temporal entity.") |
37 | | - (^:redef unit* [o k] |
| 37 | + (unit* [o k] |
38 | 38 | "Internal use")) |
39 | 39 |
|
40 | 40 | (defprotocol HasProperties |
41 | | - (^:redef properties [o] |
| 41 | + (properties [o] |
42 | 42 | "Map of properties present in this temporal entity") |
43 | | - (^:redef property [o k] |
| 43 | + (property [o k] |
44 | 44 | "Property of this temporal entity under key `k`")) |
45 | 45 |
|
46 | 46 | (defprotocol As |
47 | | - (^:redef as* [o k] |
| 47 | + (as* [o k] |
48 | 48 | "Value of property/unit identified by key/object `k` of the temporal |
49 | 49 | entity `o`")) |
50 | 50 |
|
51 | 51 | (defprotocol ReadableProperty |
52 | | - (^:redef value [p] |
| 52 | + (value [p] |
53 | 53 | "Value of the property")) |
54 | 54 |
|
55 | 55 | (defprotocol ReadableRangeProperty |
56 | | - (^:redef range [p] |
| 56 | + (range [p] |
57 | 57 | "Range of values for this property") |
58 | | - (^:redef min-value [p] |
| 58 | + (min-value [p] |
59 | 59 | "Minimum value of this property") |
60 | | - (^:redef largest-min-value [p] |
| 60 | + (largest-min-value [p] |
61 | 61 | "Largest minimum value of this property") |
62 | | - (^:redef smallest-max-value [p] |
| 62 | + (smallest-max-value [p] |
63 | 63 | "Smallest maximum value of this property, e.g. 28th of February for months") |
64 | | - (^:redef max-value [p] |
| 64 | + (max-value [p] |
65 | 65 | "Maximum value of this property, e.g. 29th of February for months")) |
66 | 66 |
|
67 | 67 | (defprotocol WritableProperty |
68 | | - (^:redef with-value [p v] |
| 68 | + (with-value [p v] |
69 | 69 | "Underlying temporal entity with the value of this property set to `v`")) |
70 | 70 |
|
71 | 71 | (defprotocol WritableRangeProperty |
72 | | - (^:redef with-min-value [p] |
| 72 | + (with-min-value [p] |
73 | 73 | "Underlying temporal entity with the value set to the minimum available for |
74 | 74 | this property") |
75 | | - (^:redef with-largest-min-value [p] |
| 75 | + (with-largest-min-value [p] |
76 | 76 | "Underlying temporal entity with the value set to the largest minimum |
77 | 77 | available for this property") |
78 | | - (^:redef with-smallest-max-value [p] |
| 78 | + (with-smallest-max-value [p] |
79 | 79 | "Underlying temporal entity with the value set to the smallest maximum |
80 | 80 | available for this property") |
81 | | - (^:redef with-max-value [p] |
| 81 | + (with-max-value [p] |
82 | 82 | "Underlying temporal entity with the value set to the maximum |
83 | 83 | available for this property")) |
84 | 84 |
|
85 | 85 | (defprotocol KnowsTimeBetween |
86 | | - (^:redef time-between [o e u] |
| 86 | + (time-between [o e u] |
87 | 87 | "Time between temporal entities `o` and `e` in unit `u`. |
88 | 88 |
|
89 | 89 | ``` |
|
95 | 95 | ```")) |
96 | 96 |
|
97 | 97 | (defprotocol KnowsIfLeap |
98 | | - (^:redef leap? [o] |
| 98 | + (leap? [o] |
99 | 99 | "True if the year of this entity is a leap year.")) |
100 | 100 |
|
101 | 101 | (defprotocol Truncatable |
102 | | - (^:redef truncate-to [o u] |
| 102 | + (truncate-to [o u] |
103 | 103 | "Truncates this entity to the specified time unit. Only works for units that |
104 | 104 | divide into the length of standard day without remainder (up to `:days`).")) |
105 | 105 |
|
106 | 106 | (defprotocol HasZone |
107 | | - (^:redef with-zone [o z] |
| 107 | + (with-zone [o z] |
108 | 108 | "Returns this temporal entity with the specified `ZoneId`")) |
109 | 109 |
|
110 | 110 | (defprotocol Plusable |
111 | 111 | "Internal" |
112 | | - (^:redef seq-plus [o os])) |
| 112 | + (seq-plus [o os])) |
113 | 113 |
|
114 | 114 | (defprotocol Minusable |
115 | 115 | "Internal" |
116 | | - (^:redef seq-minus [o os])) |
| 116 | + (seq-minus [o os])) |
117 | 117 |
|
118 | 118 | (defprotocol Multipliable |
119 | | - (^:redef multiply-by [o v] |
| 119 | + (multiply-by [o v] |
120 | 120 | "Entity `o` multiplied by the value `v`")) |
121 | 121 |
|
122 | 122 | (defprotocol Ordered |
123 | | - (^:redef single-before? [a b] |
| 123 | + (single-before? [a b] |
124 | 124 | "Internal use") |
125 | | - (^:redef single-after? [a b] |
| 125 | + (single-after? [a b] |
126 | 126 | "Internal use")) |
127 | 127 |
|
128 | 128 | (defn as |
|
0 commit comments