Clean Code



Download 3,58 Mb.
Pdf ko'rish
bet334/384
Sana05.04.2022
Hajmi3,58 Mb.
#530298
1   ...   330   331   332   333   334   335   336   337   ...   384
Bog'liq
Clean Code

Listing B-1 (continued)
SerialDate.Java


361
Appendix B: 
org.jfree.date.SerialDate
723 }
724 return SerialDate.addDays(adjust, base);
725 
726 }
727 
728 /**
729 * Rolls the date forward to the last day of the month.
730 *
731 * @param base the base date.
732 *
733 * @return a new serial date.
734 */
735 public SerialDate getEndOfCurrentMonth(final SerialDate base) {
736 final int last = SerialDate.lastDayOfMonth(
737 base.getMonth(), base.getYYYY()
738 );
739 return SerialDate.createInstance(last, base.getMonth(), base.getYYYY());
740 }
741 
742 /**
743 * Returns a string corresponding to the week-in-the-month code.
744 *
745 * Need to find a better approach.
746 *
747 * @param count an integer code representing the week-in-the-month.
748 *
749 * @return a string corresponding to the week-in-the-month code.
750 */
751 public static String weekInMonthToString(final int count) {
752 
753 switch (count) {
754 case SerialDate.FIRST_WEEK_IN_MONTH : return "First";
755 case SerialDate.SECOND_WEEK_IN_MONTH : return "Second";
756 case SerialDate.THIRD_WEEK_IN_MONTH : return "Third";
757 case SerialDate.FOURTH_WEEK_IN_MONTH : return "Fourth";
758 case SerialDate.LAST_WEEK_IN_MONTH : return "Last";
759 default :
760 return "SerialDate.weekInMonthToString(): invalid code.";
761 }
762 
763 }
764 
765 /**
766 * Returns a string representing the supplied 'relative'.
767 *
768 * Need to find a better approach.
769 *
770 * @param relative a constant representing the 'relative'.
771 *
772 * @return a string representing the supplied 'relative'.
773 */
774 public static String relativeToString(final int relative) {
775 
776 switch (relative) {
777 case SerialDate.PRECEDING : return "Preceding";
778 case SerialDate.NEAREST : return "Nearest";
779 case SerialDate.FOLLOWING : return "Following";
780 default : return "ERROR : Relative To String";
781 }
782 
783 }
784 

Download 3,58 Mb.

Do'stlaringiz bilan baham:
1   ...   330   331   332   333   334   335   336   337   ...   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