1
1
/*
2
2
* Zmanim Java API
3
- * Copyright (C) 2004-2020 Eliyahu Hershfeld
3
+ * Copyright (C) 2004-2025 Eliyahu Hershfeld
4
4
*
5
5
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
6
6
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
22
22
* this API. The time class is used to represent numeric time such as the time in hours, minutes, seconds and
23
23
* milliseconds of a {@link com.kosherjava.zmanim.AstronomicalCalendar#getTemporalHour() temporal hour}.
24
24
*
25
- * @author © Eliyahu Hershfeld 2004 - 2020
25
+ * @author © Eliyahu Hershfeld 2004 - 2025
26
26
*/
27
27
public class Time {
28
28
/** milliseconds in a second. */
@@ -35,26 +35,31 @@ public class Time {
35
35
private static final int HOUR_MILLIS = MINUTE_MILLIS * 60 ;
36
36
37
37
/**
38
+ * The hour.
38
39
* @see #getHours()
39
40
*/
40
41
private int hours ;
41
42
42
43
/**
44
+ * The minutes.
43
45
* @see #getMinutes()
44
46
*/
45
47
private int minutes ;
46
48
47
49
/**
50
+ * The seconds.
48
51
* @see #getSeconds()
49
52
*/
50
53
private int seconds ;
51
54
52
55
/**
56
+ * The milliseconds.
53
57
* @see #getMilliseconds()
54
58
*/
55
59
private int milliseconds ;
56
60
57
61
/**
62
+ * Is the time negative
58
63
* @see #isNegative()
59
64
* @see #setIsNegative(boolean)
60
65
*/
@@ -85,8 +90,8 @@ public Time(double millis) {
85
90
}
86
91
87
92
/**
88
- * A constructor that sets the time by milliseconds. The milliseconds are converted to hours, minutes, seconds
89
- * and milliseconds. If the milliseconds are negative it will call {@link #setIsNegative(boolean)}.
93
+ * A constructor that sets the time from milliseconds. The milliseconds are converted to hours, minutes,
94
+ * seconds and milliseconds. If the milliseconds are negative it will call {@link#setIsNegative(boolean)}.
90
95
* @param millis the milliseconds to set.
91
96
*/
92
97
public Time (int millis ) {
@@ -108,7 +113,7 @@ public Time(int millis) {
108
113
}
109
114
110
115
/**
111
- * Does the time represent a negative time 9such as using this to subtract time from another Time.
116
+ * Does the time represent a negative time, such as using this to subtract time from another Time.
112
117
* @return if the time is negative.
113
118
*/
114
119
public boolean isNegative () {
@@ -124,13 +129,15 @@ public void setIsNegative(boolean isNegative) {
124
129
}
125
130
126
131
/**
132
+ * Get the hour.
127
133
* @return Returns the hour.
128
134
*/
129
135
public int getHours () {
130
136
return this .hours ;
131
137
}
132
138
133
139
/**
140
+ * Set the hour.
134
141
* @param hours
135
142
* The hours to set.
136
143
*/
@@ -139,13 +146,15 @@ public void setHours(int hours) {
139
146
}
140
147
141
148
/**
149
+ * Get the minutes.
142
150
* @return Returns the minutes.
143
151
*/
144
152
public int getMinutes () {
145
153
return this .minutes ;
146
154
}
147
155
148
156
/**
157
+ * Set the minutes.
149
158
* @param minutes
150
159
* The minutes to set.
151
160
*/
@@ -154,13 +163,15 @@ public void setMinutes(int minutes) {
154
163
}
155
164
156
165
/**
166
+ * Get the seconds.
157
167
* @return Returns the seconds.
158
168
*/
159
169
public int getSeconds () {
160
170
return this .seconds ;
161
171
}
162
172
163
173
/**
174
+ * Set the seconds.
164
175
* @param seconds
165
176
* The seconds to set.
166
177
*/
@@ -169,13 +180,15 @@ public void setSeconds(int seconds) {
169
180
}
170
181
171
182
/**
183
+ * Get the milliseconds.
172
184
* @return Returns the milliseconds.
173
185
*/
174
186
public int getMilliseconds () {
175
187
return this .milliseconds ;
176
188
}
177
189
178
190
/**
191
+ * Set the milliseconds.
179
192
* @param milliseconds
180
193
* The milliseconds to set.
181
194
*/
0 commit comments