Clean Code



Download 3,58 Mb.
Pdf ko'rish
bet355/384
Sana05.04.2022
Hajmi3,58 Mb.
#530298
1   ...   351   352   353   354   355   356   357   358   ...   384
Bog'liq
Clean Code

Listing B-5 (continued)
SpreadsheetDate.java


385
Appendix B: 
org.jfree.date.SerialDate
187 /**
188 * Returns the serial number for the date, where 1 January 1900 = 2
189 * (this corresponds, almost, to the numbering system used in Microsoft
190 * Excel for Windows and Lotus 1-2-3).
191 *
192 * @return The serial number of this date.
193 */
194 public int toSerial() {
195 return this.serial;
196 }
197 
198 /**
199 * Returns a java.util.Date equivalent to this date.
200 *
201 * @return The date.
202 */
203 public Date toDate() {
204 final Calendar calendar = Calendar.getInstance();
205 calendar.set(getYYYY(), getMonth() - 1, getDayOfMonth(), 0, 0, 0);
206 return calendar.getTime();
207 }
208 
209 /**
210 * Returns the year (assume a valid range of 1900 to 9999).
211 *
212 * @return The year.
213 */
214 public int getYYYY() {
215 return this.year;
216 }
217 
218 /**
219 * Returns the month (January = 1, February = 2, March = 3).
220 *
221 * @return The month of the year.
222 */
223 public int getMonth() {
224 return this.month;
225 }
226 
227 /**
228 * Returns the day of the month.
229 *
230 * @return The day of the month.
231 */
232 public int getDayOfMonth() {
233 return this.day;
234 }
235 
236 /**
237 * Returns a code representing the day of the week.
238 *
239 * The codes are defined in the {@link SerialDate} class as:
240 * SUNDAY, MONDAY, TUESDAY,
241 * WEDNESDAY, THURSDAY, FRIDAY, and
242 * SATURDAY.
243 *
244 * @return A code representing the day of the week.
245 */
246 public int getDayOfWeek() {
247 return (this.serial + 6) % 7 + 1;
248 }

Download 3,58 Mb.

Do'stlaringiz bilan baham:
1   ...   351   352   353   354   355   356   357   358   ...   384




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish