├── Links.txt
├── README.md
├── doc
├── Examples.txt
├── ebooks
│ ├── IntelliJIDEA_ReferenceCard.pdf
│ └── IntelliJIDEA_ReferenceCard_Mac.pdf
├── images
│ ├── firstNotRepeatingCharacter.jpeg
│ └── ikinci-dereceden-denklem.jpg
├── notes
│ ├── 001-Temel-Kavramlar-V4.0.pdf
│ ├── 002-Turler-Bildirim-V2.2.pdf
│ ├── 003-Metotlar-V1.1.pdf
│ ├── 004-Sabitler-V2.0.pdf
│ ├── 005-Temel-Operatorler-V2.0.pdf
│ ├── 006-Deyimler-V1.1.pdf
│ ├── 007-if-deyimi-V1.1.pdf
│ ├── 008-Dongu Deyimleri-while-do-while-V1.3.pdf
│ ├── 009-for-Donguleri-V2.0.pdf
│ ├── 010-break-Deyimi-V1.0 .pdf
│ ├── 011-continue-Deyimi-V2.0.pdf
│ ├── 012-switch-Deyimi-V1.1.pdf
│ ├── 013-Tur-Donusumleri-V2.2.pdf
│ ├── 014-Kosul-Operatoru-V1.0.pdf
│ ├── 015-Method-Overloading-V1.2.pdf
│ ├── 016-NYPT-Adres-Kavramı-V1.1.pdf
│ ├── 017-Sınflarin-Elemanları-V1.0.pdf
│ ├── 018-Rastgele-Sayi-Uretilmesi-V1.0.pdf
│ ├── 019-Siniflarin-Baslangic-Metotlari.pdf
│ └── 020-String-Sınıfı-V1.0.pdf
└── setup-notes
│ ├── MacOS'ta Java'nın Kurulumu ve Terminal.docx
│ └── Windows'ta Java'nın Kurulumu.docx
├── homeworks
├── Homework-001.pdf
├── Homework-002.pdf
├── Homework-003.pdf
├── Homework-004.pdf
├── Homework-005.pdf
├── Homework-006.pdf
├── Homework-007.pdf
├── Homework-008.pdf
├── Homework-009.pdf
├── Homework-010.pdf
├── Homework-011.pdf
├── Homework-012.pdf
├── Homework-013.pdf
├── Homework-014.pdf
├── Homework-015.pdf
├── Solutions.txt
└── sudoku.txt
└── src
├── Sample
├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── modules.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── Sample.iml
├── out
│ └── production
│ │ └── Sample
│ │ └── org
│ │ └── csystem
│ │ ├── app
│ │ ├── App.class
│ │ ├── Sample.class
│ │ ├── commandprompt
│ │ │ ├── CommandPrompt.class
│ │ │ └── CommandPromptApp.class
│ │ ├── company
│ │ │ ├── CompanyApp.class
│ │ │ ├── Employee.class
│ │ │ ├── HumanResources.class
│ │ │ ├── Manager.class
│ │ │ ├── ProjectWorker.class
│ │ │ ├── SalesManager.class
│ │ │ └── Worker.class
│ │ ├── datetime
│ │ │ ├── DateApp.class
│ │ │ └── test
│ │ │ │ └── PrintRandomDateTest.class
│ │ ├── game
│ │ │ └── ballfall
│ │ │ │ └── BallFallGameApp.class
│ │ ├── lottery
│ │ │ ├── NumericLottery.class
│ │ │ └── NumericLotteryApp.class
│ │ ├── places
│ │ │ ├── PlaceInfo.class
│ │ │ └── StorePlacesToArrayApp.class
│ │ ├── randomgenerator
│ │ │ └── RandomObjectArrayGeneratorApp.class
│ │ ├── school
│ │ │ ├── LectureInfo.class
│ │ │ ├── LectureInfoParser.class
│ │ │ └── LectureInfoParserTest.class
│ │ └── simulation
│ │ │ ├── craps
│ │ │ ├── CrapsSimulation.class
│ │ │ └── CrapsSimulationApp.class
│ │ │ ├── exam
│ │ │ ├── ExamSimulation.class
│ │ │ └── ExamSimulationApp.class
│ │ │ └── lotto
│ │ │ ├── Lotto.class
│ │ │ ├── LottoProbabilitySimulation.class
│ │ │ └── LottoProbabilitySimulationApp.class
│ │ ├── game
│ │ ├── ballfall
│ │ │ └── BallFall.class
│ │ ├── card
│ │ │ ├── Card.class
│ │ │ ├── CardType.class
│ │ │ └── CardValue.class
│ │ └── craps
│ │ │ └── Craps.class
│ │ ├── randomgenerator
│ │ └── RandomObjectArrayFactory.class
│ │ └── util
│ │ ├── array
│ │ └── ArrayUtil.class
│ │ ├── collection
│ │ └── CSDArrayList.class
│ │ ├── console
│ │ └── Console.class
│ │ ├── datetime
│ │ ├── Date.class
│ │ ├── DateTime.class
│ │ ├── DateTimeException.class
│ │ ├── DateUtil.class
│ │ ├── DayOfWeek.class
│ │ ├── Month.class
│ │ ├── Time.class
│ │ └── TimeUtil.class
│ │ ├── math
│ │ ├── Complex.class
│ │ ├── Fraction.class
│ │ ├── MutableFraction.class
│ │ └── geometry
│ │ │ ├── AnalyticalCircle.class
│ │ │ ├── Circle.class
│ │ │ ├── MutablePoint.class
│ │ │ ├── Point.class
│ │ │ └── PointCommonUtil.class
│ │ ├── numeric
│ │ └── NumberUtil.class
│ │ ├── string
│ │ └── StringUtil.class
│ │ ├── tuple
│ │ ├── Pair.class
│ │ ├── Triple.class
│ │ └── Value.class
│ │ └── wrapper
│ │ ├── IntValue.class
│ │ ├── LongValue.class
│ │ └── MutableIntValue.class
└── src
│ └── org
│ └── csystem
│ ├── app
│ ├── App.java
│ ├── commandprompt
│ │ ├── CommandPrompt.java
│ │ └── CommandPromptApp.java
│ ├── company
│ │ ├── CompanyApp.java
│ │ ├── Employee.java
│ │ ├── HumanResources.java
│ │ ├── Manager.java
│ │ ├── ProjectWorker.java
│ │ ├── SalesManager.java
│ │ └── Worker.java
│ ├── datetime
│ │ ├── DateApp.java
│ │ └── test
│ │ │ └── PrintRandomDateTest.java
│ ├── game
│ │ └── ballfall
│ │ │ └── BallFallGameApp.java
│ ├── lottery
│ │ ├── NumericLottery.java
│ │ └── NumericLotteryApp.java
│ ├── places
│ │ ├── PlaceInfo.java
│ │ └── StorePlacesToArrayApp.java
│ ├── randomgenerator
│ │ └── RandomObjectArrayGeneratorApp.java
│ ├── school
│ │ ├── LectureInfo.java
│ │ ├── LectureInfoParser.java
│ │ └── LectureInfoParserTest.java
│ └── simulation
│ │ ├── craps
│ │ ├── CrapsSimulation.java
│ │ └── CrapsSimulationApp.java
│ │ ├── exam
│ │ ├── ExamSimulation.java
│ │ └── ExamSimulationApp.java
│ │ └── lotto
│ │ ├── Lotto.java
│ │ ├── LottoProbabilitySimulation.java
│ │ └── LottoProbabilitySimulationApp.java
│ ├── game
│ ├── ballfall
│ │ └── BallFall.java
│ ├── card
│ │ ├── Card.java
│ │ ├── CardType.java
│ │ └── CardValue.java
│ └── craps
│ │ └── Craps.java
│ ├── randomgenerator
│ └── RandomObjectArrayFactory.java
│ └── util
│ ├── array
│ └── ArrayUtil.java
│ ├── collection
│ └── CSDArrayList.java
│ ├── console
│ └── Console.java
│ ├── datetime
│ ├── Date.java
│ ├── DateTime.java
│ ├── DateTimeException.java
│ ├── DateUtil.java
│ ├── DayOfWeek.java
│ ├── Month.java
│ ├── Time.java
│ └── TimeUtil.java
│ ├── math
│ ├── Complex.java
│ ├── Fraction.java
│ ├── MutableFraction.java
│ └── geometry
│ │ ├── AnalyticalCircle.java
│ │ ├── Circle.java
│ │ ├── MutablePoint.java
│ │ ├── Point.java
│ │ └── PointCommonUtil.java
│ ├── numeric
│ └── NumberUtil.java
│ ├── string
│ └── StringUtil.java
│ ├── tuple
│ ├── Pair.java
│ ├── Triple.java
│ └── Value.java
│ └── wrapper
│ ├── IntValue.java
│ ├── LongValue.java
│ └── MutableIntValue.java
└── src-console
├── csd
├── App.class
├── App.java
└── Test.class
└── msd
├── Sample.class
└── Sample.java
/Links.txt:
--------------------------------------------------------------------------------
1 | Link : https://www.dropbox.com/sh/tbwbmtskiwld7ny/AADgmKiTVJIpaVPPk84mh-0_a?dl=0
2 | Github : https://github.com/oguzkaran/Java-Feb-2022
3 |
4 |
5 |
6 | İletişim Bilgileri:
7 | Oğuz Karan
8 | Email : oguzkaran@csystem.org
9 | Tel : 05325158012
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java-Feb-2022
2 | KAYNAK GÖSTERMEK KOŞULUYLA HER TÜRLÜ ALINTI YAPILABİLİR
3 |
4 | #java
5 | #programming
6 | #eclipse
7 | #intellij
8 | #spring
9 | #springboot
10 |
--------------------------------------------------------------------------------
/doc/Examples.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/Examples.txt
--------------------------------------------------------------------------------
/doc/ebooks/IntelliJIDEA_ReferenceCard.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/ebooks/IntelliJIDEA_ReferenceCard.pdf
--------------------------------------------------------------------------------
/doc/ebooks/IntelliJIDEA_ReferenceCard_Mac.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/ebooks/IntelliJIDEA_ReferenceCard_Mac.pdf
--------------------------------------------------------------------------------
/doc/images/firstNotRepeatingCharacter.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/images/firstNotRepeatingCharacter.jpeg
--------------------------------------------------------------------------------
/doc/images/ikinci-dereceden-denklem.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/images/ikinci-dereceden-denklem.jpg
--------------------------------------------------------------------------------
/doc/notes/001-Temel-Kavramlar-V4.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/001-Temel-Kavramlar-V4.0.pdf
--------------------------------------------------------------------------------
/doc/notes/002-Turler-Bildirim-V2.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/002-Turler-Bildirim-V2.2.pdf
--------------------------------------------------------------------------------
/doc/notes/003-Metotlar-V1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/003-Metotlar-V1.1.pdf
--------------------------------------------------------------------------------
/doc/notes/004-Sabitler-V2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/004-Sabitler-V2.0.pdf
--------------------------------------------------------------------------------
/doc/notes/005-Temel-Operatorler-V2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/005-Temel-Operatorler-V2.0.pdf
--------------------------------------------------------------------------------
/doc/notes/006-Deyimler-V1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/006-Deyimler-V1.1.pdf
--------------------------------------------------------------------------------
/doc/notes/007-if-deyimi-V1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/007-if-deyimi-V1.1.pdf
--------------------------------------------------------------------------------
/doc/notes/008-Dongu Deyimleri-while-do-while-V1.3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/008-Dongu Deyimleri-while-do-while-V1.3.pdf
--------------------------------------------------------------------------------
/doc/notes/009-for-Donguleri-V2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/009-for-Donguleri-V2.0.pdf
--------------------------------------------------------------------------------
/doc/notes/010-break-Deyimi-V1.0 .pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/010-break-Deyimi-V1.0 .pdf
--------------------------------------------------------------------------------
/doc/notes/011-continue-Deyimi-V2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/011-continue-Deyimi-V2.0.pdf
--------------------------------------------------------------------------------
/doc/notes/012-switch-Deyimi-V1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/012-switch-Deyimi-V1.1.pdf
--------------------------------------------------------------------------------
/doc/notes/013-Tur-Donusumleri-V2.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/013-Tur-Donusumleri-V2.2.pdf
--------------------------------------------------------------------------------
/doc/notes/014-Kosul-Operatoru-V1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/014-Kosul-Operatoru-V1.0.pdf
--------------------------------------------------------------------------------
/doc/notes/015-Method-Overloading-V1.2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/015-Method-Overloading-V1.2.pdf
--------------------------------------------------------------------------------
/doc/notes/016-NYPT-Adres-Kavramı-V1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/016-NYPT-Adres-Kavramı-V1.1.pdf
--------------------------------------------------------------------------------
/doc/notes/017-Sınflarin-Elemanları-V1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/017-Sınflarin-Elemanları-V1.0.pdf
--------------------------------------------------------------------------------
/doc/notes/018-Rastgele-Sayi-Uretilmesi-V1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/018-Rastgele-Sayi-Uretilmesi-V1.0.pdf
--------------------------------------------------------------------------------
/doc/notes/019-Siniflarin-Baslangic-Metotlari.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/019-Siniflarin-Baslangic-Metotlari.pdf
--------------------------------------------------------------------------------
/doc/notes/020-String-Sınıfı-V1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/notes/020-String-Sınıfı-V1.0.pdf
--------------------------------------------------------------------------------
/doc/setup-notes/MacOS'ta Java'nın Kurulumu ve Terminal.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/setup-notes/MacOS'ta Java'nın Kurulumu ve Terminal.docx
--------------------------------------------------------------------------------
/doc/setup-notes/Windows'ta Java'nın Kurulumu.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/doc/setup-notes/Windows'ta Java'nın Kurulumu.docx
--------------------------------------------------------------------------------
/homeworks/Homework-001.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-001.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-002.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-002.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-003.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-003.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-004.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-004.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-005.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-005.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-006.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-006.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-007.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-007.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-008.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-008.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-009.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-009.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-010.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-010.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-011.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-011.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-012.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-012.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-013.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-013.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-014.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-014.pdf
--------------------------------------------------------------------------------
/homeworks/Homework-015.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Homework-015.pdf
--------------------------------------------------------------------------------
/homeworks/Solutions.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/homeworks/Solutions.txt
--------------------------------------------------------------------------------
/homeworks/sudoku.txt:
--------------------------------------------------------------------------------
1 | 3 6 7 5 1 9 8 4 2
2 | 8 4 2 3 7 6 9 1 5
3 | 5 9 1 4 8 2 7 6 3
4 |
5 | 1 8 5 9 2 4 3 7 6
6 | 9 3 6 7 5 1 2 8 4
7 | 2 7 4 6 3 8 5 9 1
8 |
9 | 6 2 3 8 4 7 1 5 9
10 | 4 5 8 1 9 3 6 2 7
11 | 7 1 9 2 6 5 4 3 8
--------------------------------------------------------------------------------
/src/Sample/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/src/Sample/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Sample/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Sample/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/src/Sample/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Sample/Sample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/App.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/App.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/Sample.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/Sample.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/commandprompt/CommandPrompt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/commandprompt/CommandPrompt.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/commandprompt/CommandPromptApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/commandprompt/CommandPromptApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/CompanyApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/CompanyApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/Employee.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/Employee.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/HumanResources.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/HumanResources.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/Manager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/Manager.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/ProjectWorker.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/ProjectWorker.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/SalesManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/SalesManager.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/company/Worker.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/company/Worker.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/datetime/DateApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/datetime/DateApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/datetime/test/PrintRandomDateTest.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/datetime/test/PrintRandomDateTest.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/game/ballfall/BallFallGameApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/game/ballfall/BallFallGameApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/lottery/NumericLottery.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/lottery/NumericLottery.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/lottery/NumericLotteryApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/lottery/NumericLotteryApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/places/PlaceInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/places/PlaceInfo.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/places/StorePlacesToArrayApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/places/StorePlacesToArrayApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/randomgenerator/RandomObjectArrayGeneratorApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/randomgenerator/RandomObjectArrayGeneratorApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfo.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfoParser.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfoParser.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfoParserTest.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/school/LectureInfoParserTest.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/craps/CrapsSimulation.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/craps/CrapsSimulation.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/craps/CrapsSimulationApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/craps/CrapsSimulationApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/exam/ExamSimulation.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/exam/ExamSimulation.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/exam/ExamSimulationApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/exam/ExamSimulationApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/Lotto.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/Lotto.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/LottoProbabilitySimulation.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/LottoProbabilitySimulation.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/LottoProbabilitySimulationApp.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/app/simulation/lotto/LottoProbabilitySimulationApp.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/game/ballfall/BallFall.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/game/ballfall/BallFall.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/game/card/Card.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/game/card/Card.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/game/card/CardType.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/game/card/CardType.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/game/card/CardValue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/game/card/CardValue.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/game/craps/Craps.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/game/craps/Craps.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/randomgenerator/RandomObjectArrayFactory.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/randomgenerator/RandomObjectArrayFactory.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/array/ArrayUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/array/ArrayUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/collection/CSDArrayList.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/collection/CSDArrayList.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/console/Console.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/console/Console.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/Date.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/Date.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/DateTime.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/DateTime.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/DateTimeException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/DateTimeException.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/DateUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/DateUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/DayOfWeek.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/DayOfWeek.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/Month.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/Month.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/Time.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/Time.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/datetime/TimeUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/datetime/TimeUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/Complex.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/Complex.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/Fraction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/Fraction.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/MutableFraction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/MutableFraction.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/geometry/AnalyticalCircle.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/geometry/AnalyticalCircle.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Circle.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Circle.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/geometry/MutablePoint.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/geometry/MutablePoint.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Point.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Point.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/math/geometry/PointCommonUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/math/geometry/PointCommonUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/numeric/NumberUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/numeric/NumberUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/string/StringUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/string/StringUtil.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/tuple/Pair.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/tuple/Pair.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/tuple/Triple.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/tuple/Triple.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/tuple/Value.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/tuple/Value.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/wrapper/IntValue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/wrapper/IntValue.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/wrapper/LongValue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/wrapper/LongValue.class
--------------------------------------------------------------------------------
/src/Sample/out/production/Sample/org/csystem/util/wrapper/MutableIntValue.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/Sample/out/production/Sample/org/csystem/util/wrapper/MutableIntValue.class
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/App.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 | Aşağıdaki örneği inceleyiniz. Örnek durumu göstermek için yazılmıştır
3 | ----------------------------------------------------------------------------------------------------------------------*/
4 | package org.csystem.app;
5 |
6 | import java.util.Random;
7 |
8 | class App {
9 | public static void main(String [] args)
10 | {
11 | Sample s = new Sample();
12 | System.out.println(s.getValue());
13 | System.out.println("-------------------------");
14 | Sample k = new Sample(10);
15 | System.out.println(k.getValue());
16 | }
17 | }
18 |
19 | class Sample {
20 | private static final Random RANDOM = new Random();
21 | private int m_value;
22 |
23 | {
24 | m_value = RANDOM.nextInt(100);
25 | System.out.printf("value:%d%n", m_value);
26 | }
27 |
28 | public Sample()
29 | {
30 |
31 | }
32 |
33 | public Sample(int a)
34 | {
35 | m_value += a;
36 | }
37 |
38 | public int getValue()
39 | {
40 | return m_value;
41 | }
42 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/commandprompt/CommandPrompt.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.commandprompt;
2 |
3 | import org.csystem.util.string.StringUtil;
4 |
5 | import java.util.Scanner;
6 |
7 | public class CommandPrompt {
8 | private static final String [] ms_commands = {"lower", "upper", "reverse", "length", "chgprompt", "quit"};
9 | private final Scanner m_kb;
10 | private String m_prompt;
11 |
12 | private static int getCommandIndex(String cmd)
13 | {
14 | if (cmd.length() < 3)
15 | return -1;
16 |
17 | for (int i = 0; i < ms_commands.length; ++i)
18 | if (ms_commands[i].startsWith(cmd))
19 | return i;
20 |
21 | return -1;
22 | }
23 |
24 | private static void lowerCallback(String [] commandInfo)
25 | {
26 | if (commandInfo.length != 2) {
27 | System.out.println("There must be 1 argument for that command");
28 | return;
29 | }
30 |
31 | System.out.println(commandInfo[1].toLowerCase());
32 | }
33 |
34 | private static void upperCallback(String [] commandInfo)
35 | {
36 | if (commandInfo.length != 2) {
37 | System.out.println("There must be 1 argument for that command");
38 | return;
39 | }
40 |
41 | System.out.println(commandInfo[1].toUpperCase());
42 | }
43 |
44 | private static void reverseCallback(String [] commandInfo)
45 | {
46 | if (commandInfo.length != 2) {
47 | System.out.println("There must be 1 argument for that command");
48 | return;
49 | }
50 |
51 | System.out.println(StringUtil.reverse(commandInfo[1]));
52 | }
53 |
54 | private static void lengthCallback(String [] commandInfo)
55 | {
56 | if (commandInfo.length != 2) {
57 | System.out.println("There must be 1 argument for that command");
58 | return;
59 | }
60 |
61 | System.out.println(commandInfo[1].length());
62 | }
63 |
64 | private void changePromptCallback(String [] commandInfo)
65 | {
66 | if (commandInfo.length != 2) {
67 | System.out.println("There must be 1 argument for that command");
68 | return;
69 | }
70 |
71 | m_prompt = commandInfo[1];
72 | }
73 |
74 | private static void quitCallback(String [] commandInfo)
75 | {
76 | System.out.println("Thanks!...");
77 | System.out.println("C and System Programmers Association");
78 | System.exit(0);
79 | }
80 |
81 | private void doCommand(String [] commandInfo)
82 | {
83 | switch (commandInfo[0]) {
84 | case "lower" -> lowerCallback(commandInfo);
85 | case "upper" -> upperCallback(commandInfo);
86 | case "reverse" -> reverseCallback(commandInfo);
87 | case "length" -> lengthCallback(commandInfo);
88 | case "chgprompt" -> changePromptCallback(commandInfo);
89 | default -> quitCallback(commandInfo);
90 | }
91 | }
92 |
93 | private void parseCommand(String cmd)
94 | {
95 | String [] commandInfo = cmd.split("[ \t]+");
96 | int idx = getCommandIndex(commandInfo[0]);
97 |
98 | if (idx != -1) {
99 | commandInfo[0] = ms_commands[idx];
100 | doCommand(commandInfo);
101 | }
102 | else
103 | System.out.println("Invalid Command");
104 | }
105 |
106 | public CommandPrompt(String p)
107 | {
108 | m_prompt = p;
109 | m_kb = new Scanner(System.in);
110 | }
111 |
112 | public void run()
113 | {
114 | for (;;) {
115 | System.out.print(m_prompt + ">");
116 | parseCommand(m_kb.nextLine());
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/commandprompt/CommandPromptApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.commandprompt;
2 |
3 | public class CommandPromptApp {
4 | public static void run()
5 | {
6 | CommandPrompt commandPrompt = new CommandPrompt("CSD");
7 |
8 | commandPrompt.run();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/CompanyApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class CompanyApp {
4 | private static Worker getWorker() //Metot herhangi bir yerden bilgileri okuyor olarak düşününüz
5 | {
6 | Worker w = new Worker();
7 |
8 | w.setCitizenId("12345678924");
9 | w.setName("Ali");
10 | w.setAddress("Şişli");
11 | w.setFeePerHour(100.4);
12 | w.setHourPerDay(8);
13 |
14 | return w;
15 | }
16 |
17 | private static Manager getManager() //Metot herhangi bir yerden bilgileri okuyor olarak düşününüz
18 | {
19 | Manager m = new Manager();
20 |
21 | m.setName("Veli");
22 | m.setCitizenId("12345678916");
23 | m.setAddress("Mecidiyeköy");
24 | m.setSalary(30000);
25 | m.setDepartment("Pazarlama");
26 |
27 | return m;
28 | }
29 |
30 | private static SalesManager getSalesManager() //Metot herhangi bir yerden bilgileri okuyor olarak düşününüz
31 | {
32 | SalesManager sm = new SalesManager();
33 |
34 | sm.setName("Selami");
35 | sm.setCitizenId("12345678918");
36 | sm.setAddress("Beykoz");
37 | sm.setSalary(40000);
38 | sm.setDepartment("Satış");
39 | sm.setExtra(10000);
40 |
41 | return sm;
42 | }
43 |
44 | private static ProjectWorker getProjectWorker() //Metot herhangi bir yerden bilgileri okuyor olarak düşününüz
45 | {
46 | ProjectWorker pw = new ProjectWorker();
47 |
48 | pw.setCitizenId("12345678924");
49 | pw.setName("Ayşe");
50 | pw.setAddress("Riva");
51 | pw.setFeePerHour(100.4);
52 | pw.setHourPerDay(8);
53 | pw.setFeeFactor(1.5);
54 | pw.setProjectName("Chat system");
55 |
56 | return pw;
57 | }
58 |
59 |
60 | public static void run()
61 | {
62 | HumanResources hr = new HumanResources();
63 | Manager m = getManager();
64 | Worker w = getWorker();
65 | SalesManager sm = getSalesManager();
66 | ProjectWorker pw = getProjectWorker();
67 |
68 | //...
69 |
70 | hr.payInsurance(m);
71 | hr.payInsurance(w);
72 | hr.payInsurance(sm);
73 | hr.payInsurance(pw);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/Employee.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public abstract class Employee {
4 | private String m_citizenId;
5 | private String m_name;
6 | private String m_address;
7 |
8 | //...
9 |
10 | public String getCitizenId()
11 | {
12 | return m_citizenId;
13 | }
14 |
15 | public void setCitizenId(String citizenId)
16 | {
17 | //...
18 | m_citizenId = citizenId;
19 | }
20 |
21 | public String getName()
22 | {
23 | return m_name;
24 | }
25 |
26 | public void setName(String name)
27 | {
28 | //...
29 | m_name = name;
30 | }
31 |
32 | public String getAddress()
33 | {
34 | return m_address;
35 | }
36 |
37 | public void setAddress(String address)
38 | {
39 | //...
40 | m_address = address;
41 | }
42 |
43 | public abstract double calculateInsurancePayment();
44 | //...
45 | }
46 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/HumanResources.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class HumanResources {
4 | //...
5 | public void payInsurance(Employee employee)
6 | {
7 | System.out.println("--------------------------------------");
8 | System.out.printf("Citizen Id:%s%n", employee.getCitizenId());
9 | System.out.printf("Name:%s%n", employee.getName());
10 | System.out.printf("Insurance Payment:%f%n", employee.calculateInsurancePayment());
11 | System.out.println("--------------------------------------");
12 |
13 | //...
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/Manager.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class Manager extends Employee {
4 | private double m_salary;
5 | private String m_department;
6 | //...
7 |
8 |
9 | public double getSalary()
10 | {
11 | return m_salary;
12 | }
13 |
14 | public void setSalary(double salary)
15 | {
16 | //...
17 | m_salary = salary;
18 | }
19 |
20 | public String getDepartment()
21 | {
22 | return m_department;
23 | }
24 |
25 | public void setDepartment(String department)
26 | {
27 | //...
28 | m_department = department;
29 | }
30 |
31 | public double calculateInsurancePayment()
32 | {
33 | return m_salary * 1.6;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/ProjectWorker.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class ProjectWorker extends Worker {
4 | private double m_feeFactor;
5 | private String m_projectName;
6 | //...
7 |
8 |
9 | public double getFeeFactor()
10 | {
11 | return m_feeFactor;
12 | }
13 |
14 | public void setFeeFactor(double feeFactor)
15 | {
16 | //...
17 | m_feeFactor = feeFactor;
18 | }
19 |
20 | public String getProjectName()
21 | {
22 | return m_projectName;
23 | }
24 |
25 | public void setProjectName(String projectName)
26 | {
27 | //...
28 | m_projectName = projectName;
29 | }
30 |
31 | public double calculateInsurancePayment()
32 | {
33 | return super.calculateInsurancePayment() * m_feeFactor;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/SalesManager.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class SalesManager extends Manager {
4 | private double m_extra;
5 |
6 | //...
7 |
8 | public double getExtra()
9 | {
10 | return m_extra;
11 | }
12 |
13 | public void setExtra(double extra)
14 | {
15 | //...
16 | m_extra = extra;
17 | }
18 |
19 | public double calculateInsurancePayment()
20 | {
21 | return super.calculateInsurancePayment() + m_extra * 1.3;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/company/Worker.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.company;
2 |
3 | public class Worker extends Employee {
4 | private int m_hourPerDay;
5 | private double m_feePerHour;
6 | //...
7 |
8 |
9 | public int getHourPerDay()
10 | {
11 | return m_hourPerDay;
12 | }
13 |
14 | public void setHourPerDay(int hourPerDay)
15 | {
16 | //...
17 | m_hourPerDay = hourPerDay;
18 | }
19 |
20 | public double getFeePerHour()
21 | {
22 | return m_feePerHour;
23 | }
24 |
25 | public void setFeePerHour(double feePerHour)
26 | {
27 | //...
28 | m_feePerHour = feePerHour;
29 | }
30 |
31 | public double calculateInsurancePayment()
32 | {
33 | return m_feePerHour * m_hourPerDay * 30;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/datetime/DateApp.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 | Sınıf Çalışması: Parametresi ile aldığı int türden gün, ay ve yıl bilgilerine ilişkin tarihin aşağıdaki açıklamalara
3 | göre haftanın hangi gününe geldiğini döndüren getDayOfWeek isimli metodu yazınız ve aşağıdaki kod ile test ediniz.
4 | Açıklamalar:
5 | - Metot geçersiz bir tarih durumunda -1 değerine geri dönecektir
6 | - Haftanın günü 1.1.1900 ile verilen tarih arasındaki (verilen tarih dahil) gün sayısının 7(yedi) ile bölümünden
7 | elde edilen kalan ile belirlenebilir. Buna göre değer sıfır ise "pazar", 1 ise "pazartesi", ..., 6 ise "cumartesi"
8 | günlerine karşılık gelir
9 |
10 | - 1.1.1900 öncesindeki tarihler geçersiz sayılacaktır
11 | - getDayOfWeek metodu ile birlikte
12 |
13 | - İleride daha iyisi yazılacaktır parametresi ile aldığı int türden gün, ay ve yıl bilgilerine ilişkin tarihin
14 | hafta sonu olup olmadığınıu test eden isWeekend ve hafta içi olup olmadığını test eden isWeekday metotlarını yazınız.
15 | Bu iki metot tarih geçerlilik kontrolü yapmayacaktır
16 |
17 | - İleride daha yazılacaktır
18 | ----------------------------------------------------------------------------------------------------------------------*/
19 | package org.csystem.app.datetime;
20 |
21 | import org.csystem.util.datetime.Date;
22 | import org.csystem.util.datetime.DateTimeException;
23 |
24 | public class DateApp {
25 |
26 | private static void printDateTR(int day, int month, int year)
27 | {
28 | try {
29 | Date d = new Date(day, month, year);
30 |
31 | System.out.println(d.toLongDateStringTR());
32 | System.out.println(d.isWeekend() ? "Bugün kurs var. Tekrar yaptınız mı?" : "Kurs günü yaklaşıyor. Tekrar yapmayı unutmayınız!...");
33 | }
34 | catch (DateTimeException ignore) {
35 | System.out.println("Geçersiz değerler");
36 | }
37 | }
38 |
39 | private static void printDateEN(int day, int month, int year)
40 | {
41 | try {
42 | Date d = new Date(day, month, year);
43 |
44 | System.out.println(d.toLongDateStringEN());
45 | System.out.println(d.isWeekend() ? "That is the course day. Did you review?" : "Course day is coming. Do not forget to review!...");
46 | }
47 | catch (DateTimeException ignore) {
48 | System.out.println("Invalid values");
49 | }
50 | }
51 | public static void run()
52 | {
53 | java.util.Scanner kb = new java.util.Scanner(System.in);
54 |
55 | for (;;) {
56 | System.out.print("Gün ay ve yıl bilgilerini giriniz?");
57 | int day = kb.nextInt();
58 | int month = kb.nextInt();
59 | int year = kb.nextInt();
60 |
61 | if (day == 0)
62 | break;
63 |
64 | printDateTR(day, month, year);
65 | printDateEN(day, month, year);
66 | }
67 |
68 | System.out.println("Tekrar yapıyor musunuz?");
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/datetime/test/PrintRandomDateTest.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 | Homework-007-2. sorunun bir çözümü
3 | (İleride daha iyisi yazılacaktır)
4 | ----------------------------------------------------------------------------------------------------------------------*/
5 | package org.csystem.app.datetime.test;
6 |
7 | import org.csystem.util.datetime.DateUtil;
8 |
9 | import java.util.Random;
10 |
11 | public class PrintRandomDateTest {
12 | private static void printRandomDate(Random r)
13 | {
14 | System.out.println("------------------------------------------");
15 | System.out.println(DateUtil.randomDate(r, 1900, 2100).toShortDateStringEN());
16 | System.out.println("------------------------------------------");
17 | }
18 |
19 | private static void printRandomDate()
20 | {
21 | printRandomDate(new java.util.Random());
22 | }
23 | public static void run()
24 | {
25 | java.util.Random r = new java.util.Random();
26 | java.util.Scanner kb = new java.util.Scanner(System.in);
27 |
28 | System.out.print("Bir sayı giriniz:");
29 | int count = Integer.parseInt(kb.nextLine());
30 |
31 | for (int i = 0; i < count; ++i)
32 | printRandomDate(r);
33 | }
34 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/game/ballfall/BallFallGameApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.game.ballfall;
2 |
3 | import org.csystem.game.ballfall.BallFall;
4 |
5 | public class BallFallGameApp {
6 | public static void run()
7 | {
8 | java.util.Scanner kb = new java.util.Scanner(System.in);
9 | BallFall bf = new BallFall();
10 |
11 | for (;;) {
12 | System.out.print("Width:");
13 | int width = Integer.parseInt(kb.nextLine());
14 |
15 | if (width == 0)
16 | break;
17 |
18 | System.out.print("Height:");
19 | int height =Integer.parseInt(kb.nextLine());
20 |
21 |
22 | bf.play(width, height);
23 |
24 | System.out.println(bf.getShape());
25 | }
26 |
27 | System.out.println("Tekrar yapıyor musunuz?");
28 | }
29 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/lottery/NumericLottery.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.lottery;
2 |
3 | import java.util.Random;
4 |
5 | public class NumericLottery {
6 | private final Random m_random;
7 |
8 | private static int [] getNumbers(boolean [] flags)
9 | {
10 | int [] numbers = new int[6];
11 |
12 | int idx = 0;
13 |
14 | for (int i = 1; i < 50; ++i)
15 | if (flags[i])
16 | numbers[idx++] = i;
17 |
18 | return numbers;
19 | }
20 |
21 | private boolean [] getFlags()
22 | {
23 | boolean [] flags = new boolean[50];
24 |
25 | for (int i = 0; i < 6; ++i) {
26 | int a;
27 |
28 | for (;;) {
29 | a = m_random.nextInt(1, 49);
30 | if (!flags[a])
31 | break;
32 | }
33 | flags[a] = true;
34 | }
35 |
36 | return flags;
37 | }
38 |
39 | public NumericLottery()
40 | {
41 | m_random = new Random();
42 | }
43 |
44 | public NumericLottery(Random r)
45 | {
46 | m_random = r;
47 | }
48 |
49 | public int[] getNumbers()
50 | {
51 | return getNumbers(getFlags());
52 | }
53 |
54 | public int [][] getNumbers(int count)
55 | {
56 | int [][] numbers = new int[count][];
57 |
58 | for (int i = 0; i < count; ++i)
59 | numbers[i] = getNumbers();
60 |
61 | return numbers;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/lottery/NumericLotteryApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.lottery;
2 |
3 | import org.csystem.util.array.ArrayUtil;
4 |
5 | import java.util.Scanner;
6 |
7 | public class NumericLotteryApp {
8 | public static void run()
9 | {
10 | Scanner kb = new Scanner(System.in);
11 | NumericLottery lottery = new NumericLottery();
12 |
13 | for (;;) {
14 | System.out.print("Kaç tane kupon oynamak istersiniz:");
15 | int n = Integer.parseInt(kb.nextLine());
16 |
17 | if (n <= 0)
18 | break;
19 |
20 | ArrayUtil.print(2, lottery.getNumbers(n));
21 | }
22 |
23 | System.out.println("Tekrar yapıyor musunuz?");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/places/PlaceInfo.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.places;
2 |
3 | public class PlaceInfo {
4 | private String m_name;
5 | private double m_latitude;
6 | private double m_longitude;
7 | //...
8 |
9 | public PlaceInfo(String name, double latitude, double longitude)
10 | {
11 | m_name = name;
12 | m_latitude = latitude;
13 | m_longitude = longitude;
14 | }
15 |
16 | public String getName()
17 | {
18 | return m_name;
19 | }
20 |
21 | public void setName(String name)
22 | {
23 | //...
24 | m_name = name;
25 | }
26 |
27 | public double getLatitude()
28 | {
29 | return m_latitude;
30 | }
31 |
32 | public void setLatitude(double latitude)
33 | {
34 | //...
35 | m_latitude = latitude;
36 | }
37 |
38 | public double getLongitude()
39 | {
40 | return m_longitude;
41 | }
42 |
43 | public void setLongitude(double longitude)
44 | {
45 | //...
46 | m_longitude = longitude;
47 | }
48 |
49 | public String toString()
50 | {
51 | return String.format("Name:%s, Latitude: %f, Longitude: %f", m_name, m_latitude, m_longitude);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/places/StorePlacesToArrayApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.places;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Scanner;
5 |
6 | public class StorePlacesToArrayApp {
7 | public static void run()
8 | {
9 | Scanner kb = new Scanner(System.in);
10 | System.out.print("Input the initial \"capacity\" value:");
11 | ArrayList places = new ArrayList(Integer.parseInt(kb.nextLine()));
12 |
13 | for (;;) {
14 | System.out.print("Input name:");
15 | String name = kb.nextLine();
16 |
17 | if ("quit".equals(name))
18 | break;
19 |
20 | System.out.print("Input latitude:");
21 | double latitude = Double.parseDouble(kb.nextLine());
22 |
23 | System.out.print("Input longitude:");
24 | double longitude = Double.parseDouble(kb.nextLine());
25 |
26 | places.add(new PlaceInfo(name, latitude, longitude));
27 | System.out.printf("Size:%d%n", places.size());
28 | }
29 |
30 | System.out.println("-------------------------------------------------------");
31 |
32 | for (Object o : places) {
33 | PlaceInfo pi = (PlaceInfo)o;
34 |
35 | System.out.println(pi.toString());
36 | }
37 |
38 | System.out.printf("Size:%d%n", places.size());
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/randomgenerator/RandomObjectArrayGeneratorApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.randomgenerator;
2 |
3 | import org.csystem.randomgenerator.RandomObjectArrayFactory;
4 | import org.csystem.util.array.ArrayUtil;
5 | import org.csystem.util.math.MutableFraction;
6 | import org.csystem.util.math.geometry.Circle;
7 |
8 | import java.util.Random;
9 | import java.util.Scanner;
10 |
11 | public class RandomObjectArrayGeneratorApp {
12 | public static void run()
13 | {
14 | Random r = new Random();
15 | RandomObjectArrayFactory factory = new RandomObjectArrayFactory(r);
16 | Scanner kb = new Scanner(System.in);
17 | System.out.print("Dizinin eleman sayısını giriniz:");
18 | int count = Integer.parseInt(kb.nextLine());
19 |
20 | for (Object o : factory.getObjects(count)) {
21 | System.out.println("-----------------------------------------------------------------");
22 | String typeName = o.getClass().getName();
23 | System.out.printf("Dinamik tür ismi:%s%n", typeName);
24 |
25 | if (o instanceof String s)
26 | System.out.println(s.toUpperCase());
27 | else if (o instanceof Circle c)
28 | System.out.printf("Alan:%f%n", c.getArea());
29 | else if (o instanceof int [] a)
30 | ArrayUtil.print(a);
31 | else if (o instanceof Integer) {
32 | int a = (int)o;
33 | System.out.printf("%d * %d = %d%n", a, a, a * a);
34 | }
35 | else if (o instanceof Character) {
36 | char ch = (char)o;
37 | System.out.printf("ch = %c%n", ch);
38 | }
39 | else if (o instanceof Boolean) {
40 | boolean flag = (boolean)o;
41 | System.out.printf("flag = %b%n", flag);
42 | }
43 | else if (o instanceof MutableFraction f)
44 | System.out.printf("Real Value:%f%n", f.getRealValue());
45 |
46 | System.out.println("-----------------------------------------------------------------");
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/school/LectureInfo.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.school;
2 |
3 | import org.csystem.util.datetime.Date;
4 |
5 | public class LectureInfo {
6 | private String m_studentName;
7 | private String m_lectureName;
8 | private Date m_midtermDate;
9 | private Date m_finalDate;
10 | private int m_midtermGrade;
11 | private int m_finalGrade;
12 |
13 | public String getStudentName()
14 | {
15 | return m_studentName;
16 | }
17 |
18 | public void setStudentName(String studentName)
19 | {
20 | m_studentName = studentName;
21 | }
22 |
23 | public String getLectureName()
24 | {
25 | return m_lectureName;
26 | }
27 |
28 | public void setLectureName(String lectureName)
29 | {
30 | m_lectureName = lectureName;
31 | }
32 |
33 | public Date getMidtermDate()
34 | {
35 | return m_midtermDate;
36 | }
37 |
38 | public void setMidtermDate(Date midtermDate)
39 | {
40 | m_midtermDate = midtermDate;
41 | }
42 |
43 | public Date getFinalDate()
44 | {
45 | return m_finalDate;
46 | }
47 |
48 | public void setFinalDate(Date finalDate)
49 | {
50 | m_finalDate = finalDate;
51 | }
52 |
53 | public int getMidtermGrade()
54 | {
55 | return m_midtermGrade;
56 | }
57 |
58 | public void setMidtermGrade(int midtermGrade)
59 | {
60 | m_midtermGrade = midtermGrade;
61 | }
62 |
63 | public int getFinalGrade()
64 | {
65 | return m_finalGrade;
66 | }
67 |
68 | public void setFinalGrade(int finalGrade)
69 | {
70 | m_finalGrade = finalGrade;
71 | }
72 |
73 | public int getGrade()
74 | {
75 | return (int)Math.round(m_midtermGrade * 0.4 + m_finalGrade * 0.6);
76 | }
77 |
78 | //...
79 | }
80 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/school/LectureInfoParser.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.school;
2 |
3 | import org.csystem.util.datetime.Date;
4 |
5 | public class LectureInfoParser {
6 | private final LectureInfo m_lectureInfo;
7 |
8 | private static Date getDate(String str)
9 | {
10 | String [] dateInfo = str.split("[/]");
11 |
12 | int day = Integer.parseInt(dateInfo[0]);
13 | int month = Integer.parseInt(dateInfo[1]);
14 | int year = Integer.parseInt(dateInfo[2]);
15 |
16 | return new Date(day, month, year);
17 | }
18 |
19 | public LectureInfoParser(String str)
20 | {
21 | //...
22 |
23 | String [] lectureInfoStr = str.split("[:]+");
24 |
25 | //...
26 |
27 | m_lectureInfo = new LectureInfo();
28 | m_lectureInfo.setStudentName(lectureInfoStr[0]);
29 | m_lectureInfo.setLectureName(lectureInfoStr[1]);
30 | m_lectureInfo.setMidtermDate(getDate(lectureInfoStr[2]));
31 | m_lectureInfo.setFinalDate(getDate(lectureInfoStr[3]));
32 | m_lectureInfo.setMidtermGrade(Integer.parseInt(lectureInfoStr[4]));
33 | m_lectureInfo.setFinalGrade(Integer.parseInt(lectureInfoStr[5]));
34 | }
35 |
36 | public LectureInfo getLectureInfo()
37 | {
38 | return m_lectureInfo;
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/school/LectureInfoParserTest.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 | Sınıf Çalışması: Klavyeden aşağıdaki formatta girilen bilgiyi ayrıştırarak ekrana sonuçları yazdıran programı
3 | yazınız:
4 | :::::
5 | Oğuz Karan:Matematik:04/04/2022:01/07/2022:78:67
6 | Barış Er:Radyo Haberleşmesi:03/04/2022:02/07/2022:89:100
7 | Ziya ÇAYLAN:PLC Programlama:10/04/2022:13/06/2022:90:98
8 | Emirhan Kabal:Fizik:07/03/2022:03/07/2022:85:75
9 | Ozan Yiğit:İstatistik:07/04/2017:19/06/2017:90:100
10 | Yunus Emre Uslu:Yazlım Geliştirme:28/04/2022:28/06/2022:60:70
11 |
12 | Açıklamalar:
13 | - Format geçerlilik kontrolü yapılmayacaktır
14 | - Formatta vize ve final notlarına göre vize * 0.4 + final * 0.6 formülü ile geçme notu hesaplanacak ve sınav
15 | tarihleri hangi güne geldiği de belirlenerek ekrana yazdırılacaktır
16 | - Ekran çıktısında "Geçti" ya da "Kaldı" bilgisi de olacaktır. Geçme notu 50 ve üstünde ise öğrenci geçmiş
17 | sayılacaktır.
18 | - Geçme notu round işlemi ile tamsayı olarak elde edilecektir
19 | - İleride daha iyisi yazılacaktır
20 |
21 | Örnek çıktı:
22 | -------------------------------------------
23 | Ad Soyad: Oğuz Karan
24 | Ders Adı: Matematik
25 | Arasınav Tarihi: 4 Nisan 2022 Pazartesi
26 | Final Tarihi: 1 Temmuz 2022 Cuma
27 | Arasınav Notu: 78
28 | Final Notu: 67
29 | Geçme Notu: 71
30 | Sonuç: Geçti
31 | -------------------------------------------
32 | ----------------------------------------------------------------------------------------------------------------------*/
33 | package org.csystem.app.school;
34 |
35 | import java.util.Scanner;
36 |
37 | public class LectureInfoParserTest {
38 | private static void printLectureInfo(LectureInfo lectureInfo)
39 | {
40 | int grade = lectureInfo.getGrade();
41 |
42 | System.out.printf("Adı Soyadı:%s%n", lectureInfo.getStudentName());
43 | System.out.printf("Ders Adı:%s%n", lectureInfo.getLectureName());
44 | System.out.printf("Arasınav Tarihi:%s%n", lectureInfo.getMidtermDate().toLongDateStringTR());
45 | System.out.printf("Final Tarihi:%s%n", lectureInfo.getFinalDate().toLongDateStringTR());
46 | System.out.printf("Arasınav Notu:%d%n", lectureInfo.getMidtermGrade());
47 | System.out.printf("Final Notu:%d%n", lectureInfo.getFinalGrade());
48 | System.out.printf("Geçme Notu:%d%n", grade);
49 | System.out.printf("Sonuç:%s%n", grade >= 50 ? "Geçti" : "Kaldı");
50 | }
51 |
52 | public static void run()
53 | {
54 | Scanner kb = new Scanner(System.in);
55 |
56 | for (;;) {
57 | System.out.print("Formatlı yazıyı giriniz:");
58 | String str = kb.nextLine();
59 |
60 | if ("elma".equals(str))
61 | break;
62 |
63 | LectureInfoParser parser = new LectureInfoParser(str);
64 | LectureInfo lectureInfo = parser.getLectureInfo();
65 |
66 | printLectureInfo(lectureInfo);
67 | }
68 |
69 | System.out.println("Tekrar yapıyor musunuz?");
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/craps/CrapsSimulation.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.craps;
2 |
3 | import org.csystem.game.craps.Craps;
4 |
5 | public class CrapsSimulation {
6 | private double m_p;
7 |
8 | public double getProbability()
9 | {
10 | return m_p;
11 | }
12 |
13 | public void run(int n)
14 | {
15 | int winCount = 0;
16 |
17 | for (int i = 0; i < n; ++i) {
18 | Craps craps = new Craps();
19 |
20 | craps.play();
21 |
22 | if (craps.win)
23 | ++winCount;
24 | }
25 |
26 | m_p = (double)winCount / n;
27 | }
28 |
29 |
30 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/craps/CrapsSimulationApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.craps;
2 |
3 | public class CrapsSimulationApp {
4 | public static void run()
5 | {
6 | java.util.Scanner kb = new java.util.Scanner(System.in);
7 |
8 | for (;;) {
9 |
10 | System.out.print("Kaç kez oynamak istersiniz?");
11 | int n = kb.nextInt();
12 |
13 | if (n <= 0)
14 | break;
15 |
16 | System.out.println("-----------------------------------------");
17 | CrapsSimulation cs = new CrapsSimulation();
18 |
19 | cs.run(n);
20 | System.out.printf("Kazanma olasılığı:%f%n", cs.getProbability());
21 | System.out.println("-----------------------------------------");
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/exam/ExamSimulation.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.exam;
2 |
3 | import org.csystem.util.array.ArrayUtil;
4 |
5 | import java.util.Random;
6 | import java.util.Scanner;
7 |
8 | public class ExamSimulation {
9 | private final String m_lectureName;
10 | private int [][] m_grades;
11 | private double [] m_averages;
12 | private double m_average;
13 |
14 | private void fillGrades()
15 | {
16 | Random r = new Random();
17 | Scanner kb = new Scanner(System.in);
18 |
19 | System.out.printf("%s sınavına girecek şube sayısını giriniz:", m_lectureName);
20 | m_grades = new int[Integer.parseInt(kb.nextLine())][];
21 | m_averages = new double[m_grades.length];
22 |
23 | for (int i = 0; i < m_grades.length; ++i) {
24 | System.out.printf("%d.şubenin öğrenci sayısını giriniz:", i + 1);
25 | int count = Integer.parseInt(kb.nextLine());
26 |
27 | m_grades[i] = ArrayUtil.getRandomArray(r, count, 0, 100);
28 | }
29 | }
30 |
31 | private void findAverages()
32 | {
33 | int totalNumberOfStudents = 0;
34 | int totalGrades = 0;
35 |
36 | for (int i = 0; i < m_grades.length; ++i) {
37 | int total = ArrayUtil.sum(m_grades[i]);
38 |
39 | m_averages[i] = (double)total / m_grades[i].length;
40 | totalGrades += total;
41 | totalNumberOfStudents += m_grades[i].length;
42 | }
43 |
44 | m_average = (double)totalGrades / totalNumberOfStudents;
45 | }
46 |
47 | public ExamSimulation(String name)
48 | {
49 | m_lectureName = name;
50 | }
51 |
52 | public String getLectureName()
53 | {
54 | return m_lectureName;
55 | }
56 |
57 | public int getGrade(int i, int k)
58 | {
59 | return m_grades[i][k];
60 | }
61 |
62 | public double getClassAverage(int i)
63 | {
64 | return m_averages[i];
65 | }
66 |
67 | public double getAverage()
68 | {
69 | return m_average;
70 | }
71 |
72 | public void run()
73 | {
74 | fillGrades();
75 | findAverages();
76 | }
77 |
78 | public void printGrades()
79 | {
80 | System.out.printf("%s dersi sınav notları:%n", m_lectureName);
81 | System.out.println("--------------------------------------------------------------------------");
82 | for (int i = 0; i < m_grades.length; ++i) {
83 | System.out.printf("%d.şubenin notları:", i + 1);
84 | ArrayUtil.print(3, m_grades[i]);
85 | }
86 | System.out.println("--------------------------------------------------------------------------");
87 | }
88 |
89 | public void printAverages()
90 | {
91 | System.out.printf("%s dersi için not ortalamaları:%n", m_lectureName);
92 | System.out.println("--------------------------------------------------------------------------");
93 | for (int i = 0; i < m_averages.length; ++i)
94 | System.out.printf("%d.şubenin not ortalaması:%f%n", i + 1, m_averages[i]);
95 |
96 | System.out.printf("Okul ortalaması:%f%n", m_average);
97 | System.out.println("--------------------------------------------------------------------------");
98 | }
99 |
100 | public void printReport()
101 | {
102 | System.out.println("###############################################################################");
103 | printGrades();
104 | printAverages();
105 | System.out.println("###############################################################################");
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/exam/ExamSimulationApp.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 | Sınıf Çalışması: Bir okulda Matematik sınavı ortak olarak yapılıyor olsun. Kaç şube ve herbir şubede kaç öğrenci olduğu
3 | bilgisi klavyeden alınsın: Öğrencilerin notları rasgele belirlensin. Tüm bu işlemlerden sonra Matamatik sınavı için
4 | herbir şubenin ayrı ayrı not ortalamaları ile okulun not ortalamasını bulan simülasyonu yazınız.
5 | Açıklamalar:
6 | - Notlar int türü ile tutulacaktır
7 | - Programı mümkün olduğunca nesne yönelimli ve genel düşünerek yazınız
8 | Not: İleride daha iyisi yazılacaktır
9 | ----------------------------------------------------------------------------------------------------------------------*/
10 |
11 | package org.csystem.app.simulation.exam;
12 |
13 | public class ExamSimulationApp {
14 | public static void run()
15 | {
16 | ExamSimulation mathSimulation = new ExamSimulation("Matematik");
17 | ExamSimulation chemistrySimulation = new ExamSimulation("Kimya");
18 |
19 | mathSimulation.run();
20 | chemistrySimulation.run();
21 |
22 | mathSimulation.printReport();
23 | chemistrySimulation.printReport();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/lotto/Lotto.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.lotto;
2 |
3 | import org.csystem.util.numeric.NumberUtil;
4 |
5 | import java.util.Random;
6 |
7 | public class Lotto {
8 | private boolean m_winGame1;
9 | private boolean m_winGame2;
10 | private boolean m_winGame3;
11 | private final Random m_random;
12 |
13 | public int getFirst()
14 | {
15 | return m_random.nextInt(1, 100);
16 | }
17 |
18 | public int getSecond(int first)
19 | {
20 | int second;
21 |
22 | while ((second = m_random.nextInt(1, 100)) == first)
23 | ;
24 |
25 | return second;
26 | }
27 |
28 | public int getThird(int first, int second)
29 | {
30 | int third;
31 |
32 | while ((third = m_random.nextInt(1, 100)) == first || third == second)
33 | ;
34 |
35 | return third;
36 | }
37 |
38 | public void playGame1(int first, int second, int third)
39 | {
40 | m_winGame1 = first + second + third < 150;
41 | }
42 |
43 | public void playGame2(int first, int second, int third)
44 | {
45 | m_winGame2 = NumberUtil.isPrime(first + second + third);
46 | }
47 |
48 | public void playGame3(int first, int second, int third)
49 | {
50 | int min = NumberUtil.min(first, second, third);
51 | int mid = NumberUtil.mid(first, second, third);
52 | int max = NumberUtil.max(first, second, third);
53 |
54 | m_winGame3 = max - min > mid;
55 | }
56 |
57 | public Lotto(Random r)
58 | {
59 | m_random = r;
60 | }
61 |
62 | public boolean isWinGame1()
63 | {
64 | return m_winGame1;
65 | }
66 |
67 | public boolean isWinGame2()
68 | {
69 | return m_winGame2;
70 | }
71 |
72 | public boolean isWinGame3()
73 | {
74 | return m_winGame3;
75 | }
76 |
77 | public void play()
78 | {
79 | int first = getFirst();
80 | int second = getSecond(first);
81 | int third = getThird(first, second);
82 |
83 | playGame1(first, second, third);
84 | playGame2(first, second, third);
85 | playGame3(first, second, third);
86 | }
87 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/lotto/LottoProbabilitySimulation.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.lotto;
2 |
3 | public class LottoProbabilitySimulation {
4 | private final int m_count;
5 | private double m_game1Prob;
6 | private double m_game2Prob;
7 | private double m_game3Prob;
8 |
9 | public LottoProbabilitySimulation(int n)
10 | {
11 | m_count = n;
12 | }
13 |
14 | public int getCount()
15 | {
16 | return m_count;
17 | }
18 |
19 | public double getGame1Prob()
20 | {
21 | return m_game1Prob;
22 | }
23 |
24 | public double getGame2Prob()
25 | {
26 | return m_game2Prob;
27 | }
28 |
29 | public double getGame3Prob()
30 | {
31 | return m_game3Prob;
32 | }
33 |
34 | public void run()
35 | {
36 | java.util.Random r = new java.util.Random();
37 |
38 | int winCount1, winCount2, winCount3;
39 |
40 | winCount1 = winCount2 = winCount3 = 0;
41 |
42 | for (int i = 0; i < m_count; ++i) {
43 | Lotto lotto = new Lotto(r);
44 |
45 | lotto.play();
46 |
47 | if (lotto.isWinGame1())
48 | ++winCount1;
49 |
50 | if (lotto.isWinGame2())
51 | ++winCount2;
52 |
53 | if (lotto.isWinGame3())
54 | ++winCount3;
55 | }
56 |
57 | m_game1Prob = (double)winCount1 / m_count;
58 | m_game2Prob = (double)winCount2 / m_count;
59 | m_game3Prob = (double)winCount3 / m_count;
60 | }
61 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/app/simulation/lotto/LottoProbabilitySimulationApp.java:
--------------------------------------------------------------------------------
1 | package org.csystem.app.simulation.lotto;
2 |
3 | public class LottoProbabilitySimulationApp {
4 | public static void run()
5 | {
6 | java.util.Scanner kb = new java.util.Scanner(System.in);
7 |
8 | for (;;) {
9 | System.out.print("Bir sayı giriniz:");
10 | int count = Integer.parseInt(kb.nextLine());
11 | if (count == 0)
12 | break;
13 | LottoProbabilitySimulation simulation = new LottoProbabilitySimulation(count);
14 |
15 | simulation.run();
16 |
17 | System.out.printf("1.oyun için kazanma olasılığı:%f%n", simulation.getGame1Prob());
18 | System.out.printf("2.oyun için kazanma olasılığı:%f%n", simulation.getGame2Prob());
19 | System.out.printf("3.oyun için kazanma olasılığı:%f%n", simulation.getGame3Prob());
20 | }
21 |
22 | System.out.println("Tekrar yapıyor musunuz?");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/game/ballfall/BallFall.java:
--------------------------------------------------------------------------------
1 | package org.csystem.game.ballfall;
2 |
3 | public class BallFall {
4 | private String m_shape;
5 |
6 | private static boolean updateRightFlag(boolean isRight, int ballIndex, int width)
7 | {
8 | if (ballIndex == 0)
9 | isRight = true;
10 | else if (ballIndex == width - 1)
11 | isRight = false;
12 |
13 | return isRight;
14 | }
15 |
16 | private static int updateBallIndex(boolean isRight, int ballIndex)
17 | {
18 | if (isRight)
19 | return ballIndex + 1;
20 |
21 | return ballIndex - 1;
22 | }
23 |
24 | private void fillSpace(int begin, int end) //[begin, end)
25 | {
26 | for (int i = begin; i < end; ++i)
27 | m_shape += ' ';
28 | }
29 |
30 | private void fillBall(int ballIndex, int end)
31 | {
32 | fillSpace(0, ballIndex);
33 | m_shape += '*';
34 | fillSpace(ballIndex + 1, end);
35 | }
36 |
37 | public BallFall()
38 | {
39 | m_shape = "";
40 | }
41 |
42 | public String getShape()
43 | {
44 | return m_shape;
45 | }
46 |
47 | public void play(int width, int height)
48 | {
49 | int ballIndex = 0;
50 | boolean isRight = false;
51 |
52 | m_shape = "";
53 |
54 | for (int i = 1; i <= height; ++i) {
55 | m_shape += '|';
56 | fillBall(ballIndex, width);
57 | if (width != 1) {
58 | isRight = updateRightFlag(isRight, ballIndex, width);
59 | ballIndex = updateBallIndex(isRight, ballIndex);
60 | }
61 | m_shape += "|\r\n";
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/game/card/Card.java:
--------------------------------------------------------------------------------
1 | package org.csystem.game.card;
2 |
3 | public class Card
4 | {
5 | private CardValue m_value;
6 | private CardType m_type;
7 | //...
8 |
9 | private static void fillDeck(Card[] deck)
10 | {
11 | int idx = 0;
12 |
13 | for (CardType ct : CardType.values())
14 | for (CardValue cv : CardValue.values())
15 | deck[idx++] = new Card(cv, ct);
16 | }
17 |
18 | public static Card[] getShuffledDeck()
19 | {
20 | Card[] deck = new Card[52];
21 |
22 | fillDeck(deck);
23 |
24 | return deck;
25 | }
26 |
27 | public Card(CardValue value, CardType type)
28 | {
29 | m_value =value;
30 | m_type = type;
31 | }
32 |
33 | public Card(String name)
34 | {
35 | //...
36 | }
37 |
38 | public String getName()
39 | {
40 | //TODO:
41 | return "";
42 | }
43 |
44 | public void setName(String name)
45 | {
46 | //...
47 | }
48 |
49 | //...
50 |
51 | public String toString()
52 | {
53 | return m_type.toString() + "-" + m_value.toString();
54 | }
55 |
56 | //...
57 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/game/card/CardType.java:
--------------------------------------------------------------------------------
1 | package org.csystem.game.card;
2 |
3 | public enum CardType
4 | {
5 | SPADE, CLUB, DIAMOND, HEART
6 | }
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/game/card/CardValue.java:
--------------------------------------------------------------------------------
1 | package org.csystem.game.card;
2 |
3 | public enum CardValue
4 | {
5 | TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, KNAVE, QUEEN, KING, ACE
6 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/game/craps/Craps.java:
--------------------------------------------------------------------------------
1 | package org.csystem.game.craps;
2 |
3 | public class Craps {
4 | public boolean win;
5 |
6 | public static int roll(java.util.Random r)
7 | {
8 | return r.nextInt(1, 7) + r.nextInt(1, 7);
9 | }
10 |
11 | public void rollForIndeterminate(java.util.Random r, int result)
12 | {
13 | int total;
14 |
15 | while ((total = roll(r)) != result && total != 7)
16 | ;
17 |
18 | win = total == result;
19 | }
20 |
21 | public void play()
22 | {
23 | java.util.Random r = new java.util.Random();
24 | int total = roll(r);
25 |
26 | switch (total) {
27 | case 7, 11 -> win = true;
28 | case 2, 3, 12 -> win = false;
29 | default -> rollForIndeterminate(r, total);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/randomgenerator/RandomObjectArrayFactory.java:
--------------------------------------------------------------------------------
1 | package org.csystem.randomgenerator;
2 |
3 | import org.csystem.util.array.ArrayUtil;
4 | import org.csystem.util.math.MutableFraction;
5 | import org.csystem.util.math.geometry.Circle;
6 | import org.csystem.util.string.StringUtil;
7 |
8 | import java.util.Random;
9 |
10 | public class RandomObjectArrayFactory {
11 | private final Random m_random;
12 |
13 | //String, Circle, int [], Integer, Character, Boolean, MutableFraction
14 | private Object createObject()
15 | {
16 | return switch (m_random.nextInt(7)) {
17 | case 0 -> StringUtil.getRandomTextTR(m_random, m_random.nextInt(10, 15));
18 | case 1 -> new Circle(m_random.nextDouble(-10, 10));
19 | case 2 -> ArrayUtil.getRandomArray(m_random, m_random.nextInt(5, 10), 0, 99);
20 | case 3 -> m_random.nextInt(-128, 127);
21 | case 4 -> (char)(m_random.nextInt(26) + (m_random.nextBoolean() ? 'A': 'a'));
22 | case 5 -> m_random.nextBoolean();
23 | default -> new MutableFraction(m_random.nextInt(-10, 10), m_random.nextInt(-10, 10));
24 | };
25 | }
26 |
27 | public RandomObjectArrayFactory()
28 | {
29 | this(new Random());
30 | }
31 |
32 | public RandomObjectArrayFactory(Random random)
33 | {
34 | m_random = random;
35 | }
36 |
37 | public Object [] getObjects(int count)
38 | {
39 | Object [] objects = new Object[count];
40 |
41 | for (int i = 0; i < count; ++i)
42 | objects[i] = createObject();
43 |
44 | return objects;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/array/ArrayUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : ArrayUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 06.11.2022
5 |
6 | Utility class for array operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.array;
12 |
13 | import java.util.Random;
14 |
15 | public final class ArrayUtil {
16 | private ArrayUtil()
17 | {
18 | }
19 |
20 | private static void bubbleSortAscending(int [] a)
21 | {
22 | for (int i = 0; i < a.length - 1; ++i)
23 | for (int k = 0; k < a.length - 1 - i; ++k)
24 | if (a[k + 1] < a[k])
25 | swap(a, k, k + 1);
26 | }
27 |
28 | private static void bubbleSortDescending(int [] a)
29 | {
30 | for (int i = 0; i < a.length - 1; ++i)
31 | for (int k = 0; k < a.length - 1 - i; ++k)
32 | if (a[k] < a[k + 1])
33 | swap(a, k, k + 1);
34 | }
35 |
36 | private static void selectionSortAscending(int [] a)
37 | {
38 | int min, minIndex;
39 |
40 | for (int i = 0; i < a.length - 1; ++i) {
41 | min = a[i];
42 | minIndex = i;
43 |
44 | for (int k = i + 1; k < a.length; ++k)
45 | if (a[k] < min) {
46 | min = a[k];
47 | minIndex = k;
48 | }
49 |
50 | a[minIndex] = a[i];
51 | a[i] = min;
52 | }
53 | }
54 |
55 | private static void selectionSortDescending(int [] a)
56 | {
57 | int max, maxIndex;
58 |
59 | for (int i = 0; i < a.length - 1; ++i) {
60 | max = a[i];
61 | maxIndex = i;
62 |
63 | for (int k = i + 1; k < a.length; ++k)
64 | if (max < a[k]) {
65 | max = a[k];
66 | maxIndex = k;
67 | }
68 |
69 | a[maxIndex] = a[i];
70 | a[i] = max;
71 | }
72 | }
73 |
74 | public static void addBy(int [] a, int val)
75 | {
76 | for (int i = 0; i < a.length; ++i)
77 | a[i] += val;
78 | }
79 |
80 | public static void bubbleSort(int [] a)
81 | {
82 | bubbleSort(a, false);
83 | }
84 |
85 | public static void bubbleSort(int [] a, boolean descending)
86 | {
87 | if (descending)
88 | bubbleSortDescending(a);
89 | else
90 | bubbleSortAscending(a);
91 | }
92 |
93 | public static void drawHistogram(int [] counts, int n, char ch)
94 | {
95 | int maxVal = max(counts);
96 |
97 | for (int count : counts) {
98 | int nChar = (int)Math.floor(count * (double)n / maxVal);
99 |
100 | while (nChar-- > 0)
101 | System.out.print(ch);
102 |
103 | System.out.println();
104 | }
105 | }
106 |
107 | public static void fillRandomArray(Random r, int [] a, int min, int bound)
108 | {
109 | for (int i = 0; i < a.length; ++i)
110 | a[i] = r.nextInt(min, bound);
111 | }
112 |
113 | public static void fillRandomArray(Random r, double [] a, double min, double bound)
114 | {
115 | for (int i = 0; i < a.length; ++i)
116 | a[i] = r.nextDouble(min, bound);
117 | }
118 |
119 | public static void fillRandomArray(Random r, long [] a, long min, long bound)
120 | {
121 | for (int i = 0; i < a.length; ++i)
122 | a[i] = r.nextLong(min, bound);
123 | }
124 |
125 | public static int [] getHistogramData(int [] a, int n)
126 | {
127 | int [] counts = new int[n + 1];
128 |
129 | for (int val : a)
130 | ++counts[val];
131 |
132 | return counts;
133 | }
134 |
135 | public static int [] getRandomArray(Random r, int count, int min, int bound)
136 | {
137 | int [] a = new int[count];
138 |
139 | fillRandomArray(r, a, min, bound);
140 |
141 | return a;
142 | }
143 |
144 | public static double [] getRandomArray(Random r, int count, double min, double bound)
145 | {
146 | double [] a = new double[count];
147 |
148 | fillRandomArray(r, a, min, bound);
149 |
150 | return a;
151 | }
152 |
153 | public static long [] getRandomArray(Random r, int count, long min, long bound)
154 | {
155 | long [] a = new long[count];
156 |
157 | fillRandomArray(r, a, min, bound);
158 |
159 | return a;
160 | }
161 |
162 | public static int [][] getRandomMatrix(Random r, int m, int n, int min, int max) //[min, max]
163 | {
164 | int [][] a = new int[m][];
165 |
166 | for (int i = 0; i < m; ++i)
167 | a[i] = getRandomArray(r, n, min, max);
168 |
169 | return a;
170 | }
171 |
172 | public static int [][] getRandomSquareMatrix(Random r, int n, int min, int max) //[min, max]
173 | {
174 | return getRandomMatrix(r, n, n, min, max);
175 | }
176 |
177 | public static boolean isMatrix(int [][] a)
178 | {
179 | for (int i = 1; i < a.length; ++i)
180 | if (a[i].length != a[0].length)
181 | return false;
182 |
183 | return true;
184 | }
185 |
186 | public static boolean isSquareMatrix(int [][] a)
187 | {
188 | return isMatrix(a) && a.length == a[0].length;
189 | }
190 |
191 | public static int [] join(int [] a, int [] b)
192 | {
193 | int [] result = new int[a.length + b.length];
194 |
195 | int idx = 0;
196 |
197 | for (int val : a)
198 | result[idx++] = val;
199 |
200 | for (int val : b)
201 | result[idx++] = val;
202 |
203 | return result;
204 | }
205 |
206 | public static int max(int [] a)
207 | {
208 | int result = a[0];
209 |
210 | for (int i = 1; i < a.length; ++i)
211 | result = Math.max(result, a[i]);
212 |
213 | return result;
214 | }
215 |
216 | public static int min(int [] a)
217 | {
218 | int result = a[0];
219 |
220 | for (int i = 1; i < a.length; ++i)
221 | result = Math.min(result, a[i]);
222 |
223 | return result;
224 | }
225 |
226 | public static int partition(int [] a, int threshold)
227 | {
228 | int partitionIndex = 0;
229 |
230 | while (partitionIndex != a.length && a[partitionIndex] < threshold)
231 | ++partitionIndex;
232 |
233 | if (partitionIndex == a.length)
234 | return partitionIndex;
235 |
236 | for (int i = partitionIndex + 1; i < a.length; ++i)
237 | if (a[i] < threshold)
238 | swap(a, i, partitionIndex++);
239 |
240 | return partitionIndex;
241 | }
242 |
243 | public static void print(int n, int [] a)
244 | {
245 | String fmt = String.format("%%0%dd ", n);
246 |
247 | for (int val : a)
248 | System.out.printf(fmt, val);
249 |
250 | System.out.println();
251 | }
252 |
253 | public static void print(int [] a)
254 | {
255 | print(1, a);
256 | }
257 |
258 | public static void print(String [] s)
259 | {
260 | for (String str : s)
261 | System.out.println(str);
262 | }
263 |
264 | public static void print(int [][] a)
265 | {
266 | print(1, a);
267 | }
268 |
269 | public static void print(int n, int [][] a)
270 | {
271 | for (int [] array : a)
272 | print(n, array);
273 | }
274 |
275 |
276 | public static void reverse(char [] a)
277 | {
278 | for (int i = 0; i < a.length / 2; ++i)
279 | swap(a, i, a.length - 1 - i);
280 | }
281 |
282 | public static void reverse(int [] a)
283 | {
284 | for (int i = 0; i < a.length / 2; ++i)
285 | swap(a, i, a.length - 1 - i);
286 | }
287 |
288 | public static void selectionSort(int [] a)
289 | {
290 | selectionSort(a, false);
291 | }
292 |
293 | public static void selectionSort(int [] a, boolean descending)
294 | {
295 | if (descending)
296 | selectionSortDescending(a);
297 | else
298 | selectionSortAscending(a);
299 | }
300 |
301 | public static int sum(int [] a)
302 | {
303 | int total = 0;
304 |
305 | for (int val : a)
306 | total += val;
307 |
308 | return total;
309 | }
310 |
311 | public static int sum(int [][] a)
312 | {
313 | int total = 0;
314 |
315 | for (int [] array : a)
316 | total += sum(array);
317 |
318 | return total;
319 | }
320 |
321 | public static int sumDiagonal(int [][] a)
322 | {
323 | int total = 0;
324 |
325 | for (int i = 0; i < a.length; ++i)
326 | total += a[i][i];
327 |
328 | return total;
329 | }
330 |
331 | public static void swap(char [] a, int i, int k)
332 | {
333 | char temp = a[i];
334 | a[i] = a[k];
335 | a[k] = temp;
336 | }
337 |
338 | public static void swap(int [] a, int i, int k)
339 | {
340 | int temp = a[i];
341 | a[i] = a[k];
342 | a[k] = temp;
343 | }
344 |
345 | public static int [][] transpose(int [][] a)
346 | {
347 | int [][] result = new int[a[0].length][a.length];
348 |
349 | for (int i = 0; i < a.length; ++i)
350 | for (int j = 0; j < a[i].length; ++j)
351 | result[j][i] = a[i][j];
352 |
353 | return result;
354 | }
355 | }
356 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/collection/CSDArrayList.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : CSDArrayList.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.11.2022
5 |
6 | CSDArrayList class
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.collection;
12 |
13 | public class CSDArrayList {
14 | private static final int DEFAULT_CAPACITY = 10;
15 | private E [] m_elems;
16 | private int m_index;
17 |
18 | private static void doWorkForIllegalArgumentException(String message)
19 | {
20 | throw new IllegalArgumentException(message);
21 | }
22 |
23 | private static void doWorkForIndexOutOfBoundException(String message)
24 | {
25 | throw new IndexOutOfBoundsException(message);
26 | }
27 |
28 | private static void checkCapacity(int capacity)
29 | {
30 | if (capacity < 0)
31 | doWorkForIllegalArgumentException("Capacity value can not be negative:" + capacity);
32 | }
33 |
34 | private void checkIndex(int index)
35 | {
36 | if (index < 0 || index >= m_index)
37 | doWorkForIndexOutOfBoundException("Index out of range:" + index);
38 | }
39 |
40 | private void changeCapacity(int capacity)
41 | {
42 | Object [] temp = new Object[capacity];
43 |
44 | System.arraycopy(m_elems, 0, temp, 0, m_index);
45 | m_elems = (E[])temp;
46 | }
47 |
48 | private void enlargeCapacityIfNecessary()
49 | {
50 | if (m_elems.length == m_index)
51 | changeCapacity(m_elems.length == 0 ? 1 : m_elems.length * 2);
52 | }
53 |
54 | public CSDArrayList()
55 | {
56 | m_elems = (E[])new Object[DEFAULT_CAPACITY];
57 | }
58 |
59 |
60 | public CSDArrayList(int initialCapacity)
61 | {
62 | checkCapacity(initialCapacity);
63 | m_elems = (E[])new Object[initialCapacity];
64 | }
65 |
66 | public boolean add(E elem)
67 | {
68 | enlargeCapacityIfNecessary();
69 |
70 | m_elems[m_index++] = elem;
71 |
72 | return true;
73 | }
74 |
75 | public void add(int index, E elem)
76 | {
77 | enlargeCapacityIfNecessary();
78 |
79 | for (int i = m_index++; i > index; --i)
80 | m_elems[i] = m_elems[i - 1];
81 |
82 | m_elems[index] = elem;
83 | }
84 |
85 | public int capacity()
86 | {
87 | return m_elems.length;
88 | }
89 |
90 | public void clear()
91 | {
92 | for (int i = 0; i < m_index; ++i)
93 | m_elems[i] = null;
94 |
95 | m_index = 0;
96 | }
97 |
98 | public void ensureCapacity(int minCapacity)
99 | {
100 | if (minCapacity > m_elems.length)
101 | changeCapacity(Math.max(m_elems.length * 2, minCapacity));
102 | }
103 |
104 | public E get(int index)
105 | {
106 | checkIndex(index);
107 |
108 | return m_elems[index];
109 | }
110 |
111 | public boolean isEmpty()
112 | {
113 | return m_index == 0;
114 | }
115 |
116 | public E remove(int index)
117 | {
118 | checkIndex(index);
119 | E oldElem = m_elems[index];
120 |
121 | for (int i = index; i < m_index - 1; ++i)
122 | m_elems[i] = m_elems[i + 1];
123 |
124 | m_elems[--m_index] = null;
125 |
126 | return oldElem;
127 | }
128 |
129 | public E set(int index, E elem)
130 | {
131 | checkIndex(index);
132 | E oldElem = m_elems[index];
133 |
134 | m_elems[index] = elem;
135 |
136 | return oldElem;
137 | }
138 |
139 | public int size()
140 | {
141 | return m_index;
142 | }
143 |
144 | public void trimToSize()
145 | {
146 | if (m_index != m_elems.length)
147 | changeCapacity(m_index);
148 | }
149 |
150 | public String toString()
151 | {
152 | //TODO:
153 | return "[]";
154 | }
155 |
156 | //...
157 | }
158 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/console/Console.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Console.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 10.10.2022
5 |
6 | Utility Console class for standard input and output operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.console;
12 |
13 | import java.util.Scanner;
14 |
15 | public final class Console {
16 | private static final Scanner ms_kb = new Scanner(System.in);
17 | private Console()
18 | {
19 | }
20 |
21 | public static int readInt()
22 | {
23 | return readInt("");
24 | }
25 |
26 | public static int readInt(String message)
27 | {
28 | return readInt(message, "");
29 | }
30 |
31 | public static int readInt(String message, String errMessage)
32 | {
33 | for (;;) {
34 | try {
35 | System.out.print(message);
36 |
37 | return Integer.parseInt(ms_kb.nextLine());
38 | }
39 | catch (NumberFormatException ignore) {
40 | System.out.print(errMessage);
41 | }
42 | }
43 | }
44 |
45 |
46 | public static double readDouble()
47 | {
48 | return readDouble("");
49 | }
50 |
51 | public static double readDouble(String message)
52 | {
53 | return readDouble(message, "");
54 | }
55 |
56 | public static double readDouble(String message, String errMessage)
57 | {
58 | for (;;) {
59 | try {
60 | System.out.print(message);
61 |
62 | return Double.parseDouble(ms_kb.nextLine());
63 | }
64 | catch (NumberFormatException ignore) {
65 | System.out.print(errMessage);
66 | }
67 | }
68 | }
69 |
70 |
71 | public static long readLong()
72 | {
73 | return readLong("");
74 | }
75 |
76 | public static long readLong(String message)
77 | {
78 | return readLong(message, "");
79 | }
80 |
81 | public static long readLong(String message, String errMessage)
82 | {
83 | for (;;) {
84 | try {
85 | System.out.print(message);
86 |
87 | return Long.parseLong(ms_kb.nextLine());
88 | }
89 | catch (NumberFormatException ignore) {
90 | System.out.print(errMessage);
91 | }
92 | }
93 | }
94 |
95 | //...
96 |
97 | public static String read(String message)
98 | {
99 | System.out.print(message);
100 | return ms_kb.nextLine();
101 | }
102 |
103 | public static void write(String fmt, Object...objects)
104 | {
105 | System.out.printf(fmt, objects);
106 | }
107 |
108 | public static void writeLine(String fmt, Object...objects)
109 | {
110 | write(fmt + "\n", objects);
111 | }
112 |
113 | public static void writeLine()
114 | {
115 | writeLine("\n");
116 | }
117 | }
118 |
119 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/Date.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Date.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.11.2022
5 |
6 | Date class that represents a local date
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | import java.time.LocalDate;
14 |
15 | import static org.csystem.util.datetime.DateUtil.MONTHS;
16 | import static org.csystem.util.datetime.DateUtil.DAY_OF_WEEKS;
17 |
18 | public class Date {
19 | private static final String [] MONTHS_TR;
20 | private static final String [] DAYS_OF_WEEK_TR;
21 | private static final String [] MONTHS_EN;
22 | private static final String [] DAYS_OF_WEEK_EN;
23 |
24 | static {
25 | MONTHS_TR = new String[]{"", "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"};
26 | DAYS_OF_WEEK_TR = new String[]{"Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"};
27 | MONTHS_EN = new String[]{"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
28 | DAYS_OF_WEEK_EN = new String[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
29 | }
30 |
31 | private static int getDayOfYear(int day, int month, int year)
32 | {
33 | int totalDays = day;
34 |
35 | for (int m = month - 1; m >= 1; --m)
36 | totalDays += MONTHS[m - 1].getDays(year);
37 |
38 | return totalDays;
39 | }
40 |
41 | private static int getDayOfWeek(int day, int month, int year)
42 | {
43 | int totalDays = getDayOfYear(day, month, year);
44 |
45 | for (int y = 1900; y < year; ++y)
46 | totalDays += Month.isLeapYear(y) ? 366 : 365;
47 |
48 | return totalDays % 7;
49 | }
50 |
51 | private static String getDaySuffix(int day)
52 | {
53 | return switch (day) {
54 | case 1, 21, 31 -> "st";
55 | case 2, 22 -> "nd";
56 | case 3, 23 -> "rd";
57 | default -> "th";
58 | };
59 | }
60 |
61 | private static boolean isValidDate(int day, int month, int year)
62 | {
63 | return 1 <= day && day <= 31 && 1 <= month && month <= 12 && day <= MONTHS[month - 1].getDays(year);
64 | }
65 |
66 | private static void doWorkForException(String message)
67 | {
68 | throw new DateTimeException(message);
69 | }
70 |
71 | private static void checkDate(int day, int month, int year, String message)
72 | {
73 | if (!isValidDate(day, month, year))
74 | doWorkForException(message);
75 | }
76 |
77 | private void checkDay(int day, String message)
78 | {
79 | checkDate(day, m_month, m_year, message);
80 | }
81 |
82 | private void checkMonth(int month, String message)
83 | {
84 | checkDate(m_day, month, m_year, message);
85 | }
86 |
87 | private void checkYear(int year, String message)
88 | {
89 | checkDate(m_day, m_month, year, message);
90 | }
91 |
92 | private void set(int day, int month, int year)
93 | {
94 | m_day = day;
95 | m_month = month;
96 | m_year = year;
97 | m_dayOfWeek = getDayOfWeek(m_day, m_month, m_year);
98 | }
99 |
100 | private int m_day, m_month, m_year;
101 | private int m_dayOfWeek;
102 |
103 | public Date() //Bu ctor içerisinde yazılanların bilinmesi gerekmez. Sadece default'un anlamına odaklanınız
104 | {
105 | LocalDate today = LocalDate.now();
106 |
107 | set(today.getDayOfMonth(), today.getMonthValue(), today.getYear());
108 | }
109 |
110 | public Date(int day, Month month, int year)
111 | {
112 | this(day, month.ordinal() + 1, year);
113 | }
114 |
115 | public Date(int day, int month, int year)
116 | {
117 | checkDate(day, month, year, String.format("Invalid date value(s) -> day: %d, month value: %d, year: %d", day, month, year));
118 | set(day, month, year);
119 | }
120 |
121 | public int getDay()
122 | {
123 | return m_day;
124 | }
125 |
126 | public void setDay(int day)
127 | {
128 | if (m_day == day)
129 | return;
130 |
131 | checkDay(day, "Invalid day value:" + day);
132 | set(day, m_month, m_year);
133 | }
134 |
135 | public Month getMonth()
136 | {
137 | return MONTHS[m_month - 1];
138 | }
139 |
140 | public void setMonth(Month month)
141 | {
142 | setMonthValue(month.ordinal() + 1);
143 | }
144 |
145 | public int getMonthValue()
146 | {
147 | return m_month;
148 | }
149 |
150 | public void setMonthValue(int month)
151 | {
152 | if (m_month == month)
153 | return;
154 |
155 | checkMonth(month, "Invalid month value:" + month);
156 | set(m_day, month, m_year);
157 | }
158 |
159 | public int getYear()
160 | {
161 | return m_year;
162 | }
163 |
164 | public void setYear(int year)
165 | {
166 | if (m_year == year)
167 | return;
168 |
169 | checkYear(year, "Invalid year value:" + year);
170 | set(m_day, m_month, year);
171 | }
172 |
173 | public DayOfWeek getDayOfWeek()
174 | {
175 | return DAY_OF_WEEKS[m_dayOfWeek];
176 | }
177 |
178 | public String getDayOfWeekTR()
179 | {
180 | return DAYS_OF_WEEK_TR[m_dayOfWeek];
181 | }
182 |
183 | public String getDayOfWeekEN()
184 | {
185 | return DAYS_OF_WEEK_EN[m_dayOfWeek];
186 | }
187 |
188 | public boolean isLeapYear()
189 | {
190 | return Month.isLeapYear(m_year);
191 | }
192 |
193 | public boolean isWeekend()
194 | {
195 | return m_dayOfWeek == 0 || m_dayOfWeek == 6;
196 | }
197 |
198 | public boolean isWeekday()
199 | {
200 | return !isWeekend();
201 | }
202 |
203 | public String toString()
204 | {
205 | return toString('/');
206 | }
207 |
208 | public String toString(char delimiter)
209 | {
210 | return String.format("%02d%c%02d%c%04d", m_day, delimiter, m_month, delimiter, m_year);
211 | }
212 |
213 | public String toLongDateStringTR()
214 | {
215 | return String.format("%s %s", toShortDateStringTR(), getDayOfWeekTR());
216 | }
217 |
218 | public String toLongDateStringEN()
219 | {
220 | return String.format("%s %s", toShortDateStringEN(), getDayOfWeekEN());
221 | }
222 |
223 | public String toShortDateStringTR()
224 | {
225 | return String.format("%d %s %d", m_day, MONTHS_TR[m_month], m_year);
226 | }
227 |
228 | public String toShortDateStringEN()
229 | {
230 | return String.format("%d%s %s %d", m_day, getDaySuffix(m_day), MONTHS_EN[m_month], m_year);
231 | }
232 | }
233 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/DateTime.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : DateTime.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.08.2022
5 |
6 | DateTime class that represents a local datetime
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | public class DateTime {
14 | private final Date m_date;
15 | private final Time m_time;
16 |
17 | public DateTime(int day, Month month, int year)
18 | {
19 | this(day, month, year, 0, 0);
20 | }
21 |
22 | public DateTime(int day, Month month, int year, int hour, int minute)
23 | {
24 | this(day, month, year, hour, minute, 0);
25 | }
26 |
27 | public DateTime(int day, Month month, int year, int hour, int minute, int second)
28 | {
29 | this(day, month, year, hour, minute, second, 0);
30 | }
31 |
32 | public DateTime(int day, Month month, int year, int hour, int minute, int second, int millisecond)
33 | {
34 | this(day, month.ordinal() + 1, year, hour, minute, second, millisecond);
35 | }
36 |
37 | public DateTime(int day, int monthValue, int year, int hour, int minute, int second, int millisecond)
38 | {
39 | m_date = new Date(day, monthValue, year);
40 | m_time = new Time(hour, minute, second, millisecond);
41 | }
42 |
43 | public int getDay()
44 | {
45 | return m_date.getDay();
46 | }
47 |
48 | public void setDay(int day)
49 | {
50 | m_date.setDay(day);
51 | }
52 |
53 | public Month getMonth()
54 | {
55 | return m_date.getMonth();
56 | }
57 |
58 | public void setMonth(Month month)
59 | {
60 | m_date.setMonth(month);
61 | }
62 |
63 | public int getYear()
64 | {
65 | return m_date.getYear();
66 | }
67 |
68 | public void setYear(int year)
69 | {
70 | m_date.setYear(year);
71 | }
72 |
73 | public DayOfWeek getDayOfWeek()
74 | {
75 | return m_date.getDayOfWeek();
76 | }
77 |
78 | public String getDayOfWeekTR()
79 | {
80 | return m_date.getDayOfWeekTR();
81 | }
82 |
83 | public String getDayOfWeekEN()
84 | {
85 | return m_date.getDayOfWeekEN();
86 | }
87 |
88 | public boolean isLeapYear()
89 | {
90 | return m_date.isLeapYear();
91 | }
92 |
93 | public boolean isWeekend()
94 | {
95 | return m_date.isWeekend();
96 | }
97 |
98 | public boolean isWeekday()
99 | {
100 | return m_date.isWeekday();
101 | }
102 |
103 | public int getHour()
104 | {
105 | return m_time.getHour();
106 | }
107 |
108 | public void setHour(int hour)
109 | {
110 | m_time.setHour(hour);
111 | }
112 |
113 | public int getMinute()
114 | {
115 | return m_time.getMinute();
116 | }
117 |
118 | public void setMinute(int minute)
119 | {
120 | m_time.setMinute(minute);
121 | }
122 |
123 | public int getSecond()
124 | {
125 | return m_time.getSecond();
126 | }
127 |
128 | public void setSecond(int second)
129 | {
130 | m_time.setSecond(second);
131 | }
132 |
133 | public int getMillisecond()
134 | {
135 | return m_time.getMillisecond();
136 | }
137 |
138 | public void setMillisecond(int millisecond)
139 | {
140 | m_time.setMillisecond(millisecond);
141 | }
142 |
143 | public String toString()
144 | {
145 | return String.format("%s %s", m_date.toString('/'), m_time.toString());
146 | }
147 |
148 | public String toLongDateTimeStringTR()
149 | {
150 | return String.format("%s %s", m_date.toLongDateStringTR(), m_time.toLongTimeString());
151 | }
152 |
153 | public String toLongDateTimeStringEN()
154 | {
155 | return String.format("%s %s", m_date.toLongDateStringEN(), m_time.toLongTimeString());
156 | }
157 |
158 | public String toShortDateTimeStringTR()
159 | {
160 | return String.format("%s %s", m_date.toShortDateStringTR(), m_time.toLongTimeString());
161 | }
162 |
163 | public String toShortDateTimeStringEN()
164 | {
165 | return String.format("%s %s", m_date.toShortDateStringEN(), m_time.toLongTimeString());
166 | }
167 |
168 | public String toLongDateStringTR()
169 | {
170 | return m_date.toLongDateStringTR();
171 | }
172 |
173 | public String toLongDateStringEN()
174 | {
175 | return m_date.toLongDateStringEN();
176 | }
177 |
178 | public String toShortDateStringTR()
179 | {
180 | return m_date.toShortDateStringTR();
181 | }
182 |
183 | public String toShortDateStringEN()
184 | {
185 | return m_date.toShortDateStringEN();
186 | }
187 |
188 | public String toShortTimeString()
189 | {
190 | return m_time.toShortTimeString();
191 | }
192 |
193 | public String toLongTimeString()
194 | {
195 | return m_time.toLongTimeString();
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/DateTimeException.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : DateTimeException.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 07.10.2022
5 |
6 | DateTimeException class
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | public class DateTimeException extends RuntimeException {
14 | public DateTimeException(String message)
15 | {
16 | super(message);
17 | }
18 |
19 | public String getMessage()
20 | {
21 | return String.format("For input value:%s", super.getMessage());
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/DateUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : DateUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 31.07.2022
5 |
6 | Utility class for Date operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | import java.util.Random;
14 |
15 | public class DateUtil {
16 | private DateUtil()
17 | {
18 | }
19 |
20 | static final DayOfWeek [] DAY_OF_WEEKS = DayOfWeek.values();
21 | static final Month [] MONTHS = Month.values();
22 |
23 |
24 | public static Date randomDate()
25 | {
26 | return randomDate(new Random());
27 | }
28 |
29 | public static Date randomDate(Random r)
30 | {
31 | return randomDate(r, new Date().getYear());
32 | }
33 |
34 | public static Date randomDate(int year)
35 | {
36 | return randomDate(new Random(), year);
37 | }
38 |
39 | public static Date randomDate(Random r, int year)
40 | {
41 | return randomDate(r, year, year);
42 | }
43 |
44 | public static Date randomDate(int minYear, int maxYear)
45 | {
46 | return randomDate(new Random(), minYear, maxYear);
47 | }
48 |
49 | public static Date randomDate(Random r, int minYear, int maxYear)
50 | {
51 | int year = r.nextInt(minYear, maxYear + 1);
52 | int month = r.nextInt(1, 13);
53 | int day = r.nextInt(1, MONTHS[month - 1].getDays(year) + 1);
54 |
55 | return new Date(day, month, year);
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/DayOfWeek.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : DayOfWeek.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 31.07.2022
5 |
6 | enum class for days of week
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | public enum DayOfWeek {
14 | SUN, MON, TUE, WED, THU, FRI, SAT;
15 | }
16 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/Month.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Month.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 31.07.2022
5 |
6 | enum class for months
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | public enum Month {
14 | JAN(31), FEB(28), MAR(31), APR(30), MAY(31), JUN(30), JUL(31), AUG(31), SEP(30), OCT(31), NOV(30), DEC(31);
15 |
16 | private final int m_days;
17 |
18 | Month(int d)
19 | {
20 | m_days = d;
21 | }
22 |
23 | static boolean isLeapYear(int year)
24 | {
25 | return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
26 | }
27 |
28 | int getDays(int year)
29 | {
30 | return ordinal() == 1 && isLeapYear(year) ? 29 : m_days;
31 | }
32 | //...
33 | }
34 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/Time.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Time.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 07.10.2022
5 |
6 | Time class that represents a local time
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 |
12 | package org.csystem.util.datetime;
13 |
14 | import java.time.LocalTime;
15 |
16 | public class Time {
17 | private int m_hour, m_minute, m_second, m_millisecond;
18 |
19 | private static void doWorkForException(String message)
20 | {
21 | throw new DateTimeException(message);
22 | }
23 |
24 | private static boolean isValid(int value, int max)
25 | {
26 | return 0 <= value && value <= max;
27 | }
28 |
29 | private static boolean isValidHour(int hour)
30 | {
31 | return isValid(hour, 23);
32 | }
33 |
34 | private static boolean isValidMinute(int minute)
35 | {
36 | return isValid(minute, 59);
37 | }
38 |
39 | private static boolean isValidSecond(int second)
40 | {
41 | return isValid(second, 59);
42 | }
43 |
44 | private static boolean isValidMillisecond(int millisecond)
45 | {
46 | return isValid(millisecond, 999);
47 | }
48 |
49 | private static boolean isValidTime(int hour, int minute, int second, int millisecond)
50 | {
51 | return isValidHour(hour) && isValidMinute(minute) && isValidSecond(second) && isValidMillisecond(millisecond);
52 | }
53 |
54 | private static void checkHour(int value)
55 | {
56 | if (!isValidHour(value))
57 | doWorkForException("Invalid hour value -> " + value);
58 | }
59 |
60 | private static void checkMinute(int value)
61 | {
62 | if (!isValidMinute(value))
63 | doWorkForException("Invalid minute value -> " + value);
64 | }
65 |
66 | private static void checkSecond(int value)
67 | {
68 | if (!isValidSecond(value))
69 | doWorkForException("Invalid second value -> " + value);
70 | }
71 |
72 | private static void checkMillisecond(int value)
73 | {
74 | if (!isValidMillisecond(value))
75 | doWorkForException("Invalid millisecond value -> " + value);
76 | }
77 |
78 | private void checkTime(int hour, int minute, int second, int millisecond)
79 | {
80 | if (!isValidTime(hour, minute, second, millisecond))
81 | doWorkForException(String.format("Invalid time value(s): hour -> %d, minute -> %d, second -> %d, millisecond -> %d",
82 | hour, minute, second, millisecond));
83 | }
84 |
85 | private void set(int hour, int minute, int second, int millisecond)
86 | {
87 | m_hour = hour;
88 | m_minute = minute;
89 | m_second = second;
90 | m_millisecond = millisecond;
91 | }
92 |
93 | public Time() //Bu ctor içerisinde yazılanların bilinmesi gerekmez. Sadece default ctor'un anlamına odaklanınız
94 | {
95 | LocalTime now = LocalTime.now();
96 |
97 | m_hour = now.getHour();
98 | m_minute = now.getMinute();
99 | m_second = now.getSecond();
100 | m_millisecond = now.getNano() / 1_000_000;
101 | }
102 |
103 | public Time(int hour, int minute)
104 | {
105 | this(hour, minute, 0);
106 | }
107 |
108 | public Time(int hour, int minute, int second)
109 | {
110 | this(hour, minute, second, 0);
111 | }
112 |
113 | public Time(int hour, int minute, int second, int millisecond)
114 | {
115 | checkTime(hour, minute, second, millisecond);
116 | set(hour, minute, second, millisecond);
117 | }
118 |
119 | public int getHour()
120 | {
121 | return m_hour;
122 | }
123 |
124 | public void setHour(int hour)
125 | {
126 | if (hour == m_hour)
127 | return;
128 |
129 | checkHour(hour);
130 | m_hour = hour;
131 | }
132 |
133 | public int getMinute()
134 | {
135 | return m_minute;
136 | }
137 |
138 | public void setMinute(int minute)
139 | {
140 | if (minute == m_minute)
141 | return;
142 |
143 | checkMinute(minute);
144 | m_minute = minute;
145 | }
146 |
147 | public int getSecond()
148 | {
149 | return m_second;
150 | }
151 |
152 | public void setSecond(int second)
153 | {
154 | if (second == m_second)
155 | return;
156 |
157 | checkSecond(second);
158 | m_second = second;
159 | }
160 |
161 | public int getMillisecond()
162 | {
163 | return m_millisecond;
164 | }
165 |
166 | public void setMillisecond(int millisecond)
167 | {
168 | if (millisecond == m_millisecond)
169 | return;
170 |
171 | checkMillisecond(millisecond);
172 | m_millisecond = millisecond;
173 | }
174 |
175 | public String toString()
176 | {
177 | return String.format("%s:%02d", toShortTimeString(), m_second);
178 | }
179 |
180 | public String toShortTimeString()
181 | {
182 | return String.format("%02d:%02d", m_hour, m_minute);
183 | }
184 |
185 | public String toLongTimeString()
186 | {
187 | return String.format("%s.%03d", toString(), m_millisecond);
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/datetime/TimeUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : TimeUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.08.2022
5 |
6 | Utility class for Time operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.datetime;
12 |
13 | import java.util.Random;
14 |
15 | public class TimeUtil {
16 | private TimeUtil()
17 | {
18 | }
19 |
20 | public static Time randomTime(Random r)
21 | {
22 | return new Time(r.nextInt(24), r.nextInt(60), r.nextInt(60), r.nextInt(1000));
23 | }
24 |
25 | public static Time randomTime()
26 | {
27 | return randomTime(new Random());
28 | }
29 | }
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/Complex.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Complex.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 17.07.2022
5 |
6 | Complex class that represents a complex number
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math;
12 |
13 | import static java.lang.Math.sqrt;
14 |
15 | public class Complex {
16 | private double m_real;
17 | private double m_imag;
18 |
19 | private static Complex add(double a1, double b1, double a2, double b2)
20 | {
21 | return new Complex(a1 + a2, b1 + b2);
22 | }
23 |
24 | private static Complex subtract(double a1, double b1, double a2, double b2)
25 | {
26 | return add(a1, b1, -a2, -b2);
27 | }
28 |
29 | private static Complex multiply(double a1, double b1, double a2, double b2) //İleride bu metot gizlenecektir
30 | {
31 | return new Complex(a1 * a2 - b1 * b2, a1 * b2 + a2 * b1);
32 | }
33 |
34 | public Complex()
35 | {
36 | }
37 |
38 | public Complex(double real)
39 | {
40 | m_real = real;
41 | }
42 |
43 | public Complex(double real, double imag)
44 | {
45 | m_real = real;
46 | m_imag = imag;
47 | }
48 |
49 | public double getReal()
50 | {
51 | return m_real;
52 | }
53 |
54 | public void setReal(double real)
55 | {
56 | m_real = real;
57 | }
58 |
59 | public double getImag()
60 | {
61 | return m_imag;
62 | }
63 |
64 | public void setImag(double imag)
65 | {
66 | m_imag = imag;
67 | }
68 |
69 | public double getNorm()
70 | {
71 | return sqrt(m_real * m_real + m_imag * m_imag);
72 | }
73 |
74 | public double getLength()
75 | {
76 | return getNorm();
77 | }
78 |
79 | public Complex getConjugate()
80 | {
81 | return new Complex(m_real, -m_imag);
82 | }
83 |
84 | //add
85 | public static Complex add(double value, Complex z)
86 | {
87 | return add(value, 0, z.m_real, z.m_imag);
88 | }
89 |
90 | public Complex add(Complex other)
91 | {
92 | return add(m_real, m_imag, other.m_real, other.m_imag);
93 | }
94 |
95 | public Complex add(double value)
96 | {
97 | return add(m_real, m_imag, value, 0);
98 | }
99 |
100 | //subtract
101 | public static Complex subtract(double value, Complex z)
102 | {
103 | return subtract(value, 0, z.m_real, z.m_imag);
104 | }
105 |
106 | public Complex subtract(Complex other)
107 | {
108 | return subtract(m_real, m_imag, other.m_real, other.m_imag);
109 | }
110 |
111 | public Complex subtract(double value)
112 | {
113 | return subtract(m_real, m_imag, value, 0);
114 | }
115 |
116 |
117 | //multiply
118 | public static Complex multiply(double value, Complex z)
119 | {
120 | return multiply(value, 0, z.m_real, z.m_imag);
121 | }
122 |
123 | public Complex multiply(Complex other)
124 | {
125 | return multiply(m_real, m_imag, other.m_real, other.m_imag);
126 | }
127 |
128 | public Complex multiply(double value)
129 | {
130 | return multiply(m_real, m_imag, value, 0);
131 | }
132 |
133 | //divide (TODO)
134 |
135 | //inc
136 | public void inc(double value)
137 | {
138 | m_real += value;
139 | }
140 |
141 | public void inc()
142 | {
143 | inc(1);
144 | }
145 |
146 | //dec
147 | public void dec(double value)
148 | {
149 | inc(-value);
150 | }
151 |
152 | public void dec()
153 | {
154 | dec(1);
155 | }
156 |
157 | public String toString()
158 | {
159 | return String.format("|%.2f, %.2f| = %f", m_real, m_imag, getNorm());
160 | }
161 | }
162 |
163 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/Fraction.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Fraction.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.08.2022
5 |
6 | Immutable Fraction class that represents fraction in mathematics
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math;
12 |
13 | public class Fraction {
14 | private final int m_a, m_b;
15 |
16 | public Fraction()
17 | {
18 | m_a = 0;
19 | m_b = 1;
20 | }
21 |
22 | public Fraction(int a)
23 | {
24 | m_a = a;
25 | m_b = 1;
26 | }
27 |
28 | public Fraction(int a, int b)
29 | {
30 | //TODO:
31 | m_a = a;
32 | m_b = b;
33 | }
34 |
35 | public int getNumerator()
36 | {
37 | return m_a;
38 | }
39 |
40 | public int getDenominator()
41 | {
42 | return m_b;
43 | }
44 | public double getRealValue()
45 | {
46 | return (double)m_a / m_b;
47 | }
48 |
49 | public static Fraction add(int value, Fraction fraction)
50 | {
51 | //TODO
52 | return new Fraction();
53 | }
54 |
55 | public Fraction add(Fraction other)
56 | {
57 | //TODO
58 | return new Fraction();
59 | }
60 |
61 | public Fraction add(int value)
62 | {
63 | //TODO
64 | return new Fraction();
65 | }
66 |
67 | public static Fraction subtract(int value, Fraction fraction)
68 | {
69 | //TODO
70 | return new Fraction();
71 | }
72 |
73 | public Fraction subtract(Fraction other)
74 | {
75 | //TODO
76 | return new Fraction();
77 | }
78 |
79 | public Fraction subtract(int value)
80 | {
81 | //TODO
82 | return new Fraction();
83 | }
84 |
85 | public static Fraction multiply(int value, Fraction fraction)
86 | {
87 | //TODO
88 | return new Fraction();
89 | }
90 |
91 | public Fraction multiply(Fraction other)
92 | {
93 | //TODO
94 | return new Fraction();
95 | }
96 |
97 | public Fraction multiply(int value)
98 | {
99 | //TODO
100 | return new Fraction();
101 | }
102 |
103 | public static Fraction divide(int value, Fraction fraction)
104 | {
105 | //TODO
106 | return new Fraction();
107 | }
108 |
109 | public Fraction divide(Fraction other)
110 | {
111 | //TODO
112 | return new Fraction();
113 | }
114 |
115 | public Fraction divide(int value)
116 | {
117 | //TODO
118 | return new Fraction();
119 | }
120 |
121 |
122 | public String toString()
123 | {
124 | return String.format("%d%s", m_a, m_b == 1 ? "" : " / " + m_b + " = " + getRealValue());
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/MutableFraction.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : MutableFraction.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 07.10.2022
5 |
6 | MutableFraction class that represents fraction in mathematics
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math;
12 |
13 | public class MutableFraction {
14 | private int m_a, m_b;
15 |
16 | private static MutableFraction add(int a1, int b1, int a2, int b2)
17 | {
18 | return new MutableFraction(a1 * b2 + a2 * b1, b1 * b2);
19 | }
20 |
21 | private static MutableFraction subtract(int a1, int b1, int a2, int b2)
22 | {
23 | return add(a1, b1, -a2, b2);
24 | }
25 |
26 | private static MutableFraction multiply(int a1, int b1, int a2, int b2)
27 | {
28 | return new MutableFraction(a1 * a2, b1 * b2);
29 | }
30 |
31 | private static MutableFraction divide(int a1, int b1, int a2, int b2)
32 | {
33 | return multiply(a1, b1, b2, a2);
34 | }
35 |
36 | private static void doWorkForException(String message)
37 | {
38 | throw new IllegalArgumentException(message);
39 | }
40 |
41 | private static void check(int a, int b)
42 | {
43 | if (b == 0) {
44 | if (a == 0)
45 | doWorkForException("Indeterminate");
46 | else
47 | doWorkForException("Undefined");
48 | }
49 | }
50 |
51 | private void configureSign()
52 | {
53 | if (m_b < 0) {
54 | m_a = -m_a;
55 | m_b = -m_b;
56 | }
57 | }
58 |
59 | private void simplify()
60 | {
61 | int min = Math.min(Math.abs(m_a), m_b);
62 |
63 | for (int i = min; i >= 2; --i)
64 | if (m_a % i == 0 && m_b % i == 0) {
65 | m_a /= i;
66 | m_b /= i;
67 | break;
68 | }
69 | }
70 |
71 | private void set(int a, int b)
72 | {
73 | if (a == 0) {
74 | m_a = 0;
75 | m_b = 1;
76 | return;
77 | }
78 | m_a = a;
79 | m_b = b;
80 | configureSign();
81 | simplify();
82 | }
83 |
84 | public MutableFraction()
85 | {
86 | m_b = 1;
87 | }
88 |
89 | public MutableFraction(int a)
90 | {
91 | m_a = a;
92 | m_b = 1;
93 | }
94 |
95 | public MutableFraction(int a, int b)
96 | {
97 | check(a, b);
98 | set(a, b);
99 | }
100 |
101 | public int getNumerator()
102 | {
103 | return m_a;
104 | }
105 |
106 | public void setNumerator(int value)
107 | {
108 | if (value == m_a)
109 | return;
110 |
111 | set(value, m_b);
112 | }
113 |
114 | public int getDenominator()
115 | {
116 | return m_b;
117 | }
118 |
119 | public void setDenominator(int value)
120 | {
121 | if (value == m_b)
122 | return;
123 | check(m_a, value);
124 | set(m_a, value);
125 | }
126 |
127 | public double getRealValue()
128 | {
129 | return (double)m_a / m_b;
130 | }
131 |
132 | public static MutableFraction add(int value, MutableFraction fraction)
133 | {
134 | return add(value, 1, fraction.m_a, fraction.m_b);
135 | }
136 |
137 | public MutableFraction add(MutableFraction other)
138 | {
139 | return add(m_a, m_b, other.m_a, other.m_b);
140 | }
141 |
142 | public MutableFraction add(int value)
143 | {
144 | return add(m_a, m_b, value, 1);
145 | }
146 |
147 | public static MutableFraction subtract(int value, MutableFraction fraction)
148 | {
149 | return subtract(value, 1, fraction.m_a, fraction.m_b);
150 | }
151 |
152 | public MutableFraction subtract(MutableFraction other)
153 | {
154 | return subtract(m_a, m_b, other.m_a, other.m_b);
155 | }
156 |
157 | public MutableFraction subtract(int value)
158 | {
159 | return subtract(m_a, m_b, value, 1);
160 | }
161 |
162 | public static MutableFraction multiply(int value, MutableFraction fraction)
163 | {
164 | return multiply(value, 1, fraction.m_a, fraction.m_b);
165 | }
166 |
167 | public MutableFraction multiply(MutableFraction other)
168 | {
169 | return multiply(m_a, m_b, other.m_a, other.m_b);
170 | }
171 |
172 | public MutableFraction multiply(int value)
173 | {
174 | return multiply(m_a, m_b, value, 1);
175 | }
176 |
177 | public static MutableFraction divide(int value, MutableFraction fraction)
178 | {
179 | return divide(value, 1, fraction.m_a, fraction.m_b);
180 | }
181 |
182 | public MutableFraction divide(MutableFraction other)
183 | {
184 | return divide(m_a, m_b, other.m_a, other.m_b);
185 | }
186 |
187 | public MutableFraction divide(int value)
188 | {
189 | return divide(m_a, m_b, value, 1);
190 | }
191 |
192 | public void inc(int value)
193 | {
194 | m_a += m_b * value;
195 | }
196 |
197 | public void inc()
198 | {
199 | inc(1);
200 | }
201 |
202 | public void dec(int value)
203 | {
204 | inc(-value);
205 | }
206 |
207 | public void dec()
208 | {
209 | dec(1);
210 | }
211 |
212 | public String toString()
213 | {
214 | return String.format("%d%s", m_a, m_b == 1 ? "" : " / " + m_b + " = " + getRealValue());
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/geometry/AnalyticalCircle.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : AnalyticalCircle.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.08.2022
5 |
6 | AnalyticalCircle class that represents a circle in 2D plane
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math.geometry;
12 |
13 | public class AnalyticalCircle extends Circle {
14 | private final MutablePoint m_center;
15 |
16 | public AnalyticalCircle(double radius)
17 | {
18 | this(radius, 0, 0);
19 | }
20 |
21 | public AnalyticalCircle(int x, int y)
22 | {
23 | this(0, x, y);
24 | }
25 |
26 | public AnalyticalCircle(double radius, int x, int y)
27 | {
28 | super(radius);
29 | m_center = new MutablePoint(x, y);
30 | }
31 |
32 | public int getX()
33 | {
34 | return m_center.getX();
35 | }
36 |
37 | public void setX(int x)
38 | {
39 | m_center.setX(x);
40 | }
41 |
42 | public int getY()
43 | {
44 | return m_center.getY();
45 | }
46 |
47 | public void setY(int y)
48 | {
49 | m_center.setY(y);
50 | }
51 |
52 | public void set(int x, int y)
53 | {
54 | setX(x);
55 | setY(y);
56 | }
57 |
58 | public boolean isTangent(AnalyticalCircle other)
59 | {
60 | //TODO:
61 | return true;
62 | }
63 |
64 | public boolean isInside(int x, int y)
65 | {
66 | return m_center.distance(x, y) <= getRadius();
67 | }
68 |
69 | public void offset(int dxy)
70 | {
71 | offset(dxy, dxy);
72 | }
73 |
74 | public void offset(int dx, int dy)
75 | {
76 | m_center.offset(dx, dy);
77 | }
78 |
79 |
80 | public double radiusDistance(AnalyticalCircle other)
81 | {
82 | return m_center.distance(other.m_center);
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/geometry/Circle.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Circle.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 17.07.2022
5 |
6 | Circle class that represents a circle
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math.geometry;
12 |
13 | public class Circle {
14 | private double m_r;
15 |
16 | public Circle()
17 | {
18 | }
19 |
20 | public Circle(double r)
21 | {
22 | setRadius(r);
23 | }
24 |
25 | public double getRadius()
26 | {
27 | return m_r;
28 | }
29 |
30 | public void setRadius(double r)
31 | {
32 | m_r = Math.abs(r);
33 | }
34 |
35 | public double getArea()
36 | {
37 | return Math.PI * m_r * m_r;
38 | }
39 |
40 | public double getCircumference()
41 | {
42 | return 2 * Math.PI * m_r;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/geometry/MutablePoint.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : MutablePoint.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 24.07.2022
5 |
6 | MutablePoint class that represents a 2(two) dimensional point in
7 | Cartesian plane
8 |
9 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
10 | All Rights Free
11 | -----------------------------------------------------------------------*/
12 | package org.csystem.util.math.geometry;
13 |
14 | public class MutablePoint {
15 | private int m_x;
16 | private int m_y;
17 |
18 | public MutablePoint()
19 | {
20 | }
21 |
22 | public MutablePoint(int x)
23 | {
24 | m_x = x;
25 | }
26 |
27 | public MutablePoint(int x, int y)
28 | {
29 | m_x = x;
30 | m_y = y;
31 | }
32 |
33 | public int getX()
34 | {
35 | return m_x;
36 | }
37 |
38 | public void setX(int x)
39 | {
40 | m_x = x;
41 | }
42 |
43 | public int getY()
44 | {
45 | return m_y;
46 | }
47 |
48 | public void setY(int y)
49 | {
50 | m_y = y;
51 | }
52 |
53 | public double distance()
54 | {
55 | return distance(0, 0);
56 | }
57 |
58 | public double distance(MutablePoint other)
59 | {
60 | return distance(other.m_x, other.m_y);
61 | }
62 |
63 | public double distance(int x, int y)
64 | {
65 | return PointCommonUtil.distance(m_x, m_y, x, y);
66 | }
67 |
68 | public void offset(int dxy)
69 | {
70 | offset(dxy, dxy);
71 | }
72 |
73 | public void offset(int dx, int dy)
74 | {
75 | m_x += dx;
76 | m_y += dy;
77 | }
78 |
79 | public Point toPoint()
80 | {
81 | return new Point(m_x, m_y);
82 | }
83 |
84 | public String toString()
85 | {
86 | return PointCommonUtil.toString(m_x, m_y);
87 | }
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/geometry/Point.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Point.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 07.08.2022
5 |
6 | Immutable Point class that represents a 2(two) dimensional point in
7 | Cartesian plane
8 |
9 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
10 | All Rights Free
11 | -----------------------------------------------------------------------*/
12 | package org.csystem.util.math.geometry;
13 |
14 | public class Point {
15 | private final int m_x;
16 | private final int m_y;
17 |
18 | public Point()
19 | {
20 | this(0);
21 | }
22 |
23 | public Point(int x)
24 | {
25 | this(x, 0);
26 | }
27 |
28 | public Point(int x, int y)
29 | {
30 | m_x = x;
31 | m_y = y;
32 | }
33 |
34 | public int getX()
35 | {
36 | return m_x;
37 | }
38 |
39 | public int getY()
40 | {
41 | return m_y;
42 | }
43 |
44 |
45 | public double distance()
46 | {
47 | return distance(0, 0);
48 | }
49 |
50 | public double distance(Point other)
51 | {
52 | return distance(other.m_x, other.m_y);
53 | }
54 |
55 | public double distance(int x, int y)
56 | {
57 | return PointCommonUtil.distance(m_x, m_y, x, y);
58 | }
59 |
60 | public Point offset(int dxy)
61 | {
62 | return offset(dxy, dxy);
63 | }
64 |
65 | public Point offset(int dx, int dy)
66 | {
67 | return new Point(m_x + dx, m_y + dy);
68 | }
69 |
70 | public MutablePoint toMutablePoint()
71 | {
72 | return new MutablePoint(m_x, m_y);
73 | }
74 |
75 | public String toString()
76 | {
77 | return PointCommonUtil.toString(m_x, m_y);
78 | }
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/math/geometry/PointCommonUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : PointCommonUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 24.07.2022
5 |
6 | Friendly Utility class for Point and MutablePoint
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.math.geometry;
12 |
13 | import static java.lang.Math.pow;
14 | import static java.lang.Math.sqrt;
15 |
16 | class PointCommonUtil {
17 | private PointCommonUtil()
18 | {
19 | }
20 |
21 | public static double distance(int x1, int y1, int x2, int y2)
22 | {
23 | return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
24 | }
25 |
26 | public static String toString(int x, int y)
27 | {
28 | return String.format("(%d, %d)", x, y);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/numeric/NumberUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : NumberUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.11.2022
5 |
6 | Utility class for numeric operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.numeric;
12 |
13 | import static java.lang.Math.*;
14 |
15 | public final class NumberUtil {
16 |
17 | private static final String [] ONES;
18 | private static final String [] TENS;
19 |
20 | static {
21 | ONES = new String[]{"", "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz"};
22 | TENS = new String[]{"", "on", "yirmi", "otuz", "kırk", "elli", "altmış", "yetmiş", "seksen", "doksan"};
23 | }
24 |
25 | private NumberUtil()
26 | {
27 | }
28 |
29 | private static int [] getDigits(long a, int n)
30 | {
31 | a = Math.abs(a);
32 | int [] result = new int[a == 0 ? 1 : (int)(log10(a) / n) + 1];
33 | int powOfTen = (int)pow(10, n);
34 |
35 | for (int i = result.length - 1; i >= 0; result[i--] = (int)(a % powOfTen), a /= powOfTen)
36 | ;
37 |
38 | return result;
39 | }
40 |
41 | private static String numToText3DigitsTR(String str, int val)
42 | {
43 | int a = val / 100;
44 | int b = val / 10 % 10;
45 | int c = val % 10;
46 |
47 | if (a != 0) {
48 | if (a != 1)
49 | str += ONES[a];
50 | str += "yüz";
51 | }
52 |
53 | if (b != 0)
54 | str += TENS[b];
55 |
56 | if (c != 0)
57 | str += ONES[c];
58 |
59 | return str;
60 | }
61 |
62 | private static String numToText3DigitsTR(int val)
63 | {
64 | return val == 0 ? "sıfır" : numToText3DigitsTR(val < 0 ? "eksi" : "", Math.abs(val));
65 | }
66 |
67 | public static boolean areFriends(int a, int b)
68 | {
69 | return sumFactors(a) == b && sumFactors(b) == a;
70 | }
71 |
72 | public static int calculateDigitalRoot(int a)
73 | {
74 | int root = abs(a);
75 |
76 | while (root > 9)
77 | root = digitsSum(root);
78 |
79 | return root;
80 | }
81 |
82 | public static int countDigits(long a)
83 | {
84 | return a == 0 ? 1 : (int)log10(abs(a)) + 1;
85 | }
86 |
87 | public static int digitsSum(int a)
88 | {
89 | int sum = 0;
90 |
91 | while (a != 0) {
92 | sum += a % 10;
93 | a /= 10;
94 | }
95 |
96 | return sum;
97 | }
98 |
99 | public static int factorial(int n)
100 | {
101 | int result = 1;
102 |
103 | for (int i = 2; i <= n; ++i)
104 | result *= i;
105 |
106 | return result;
107 | }
108 | public static int fibonacciNumber(int n)
109 | {
110 | if (n <= 2)
111 | return n - 1;
112 |
113 | int prev1 = 1, prev2 = 0, val = 0;
114 |
115 | for (int i = 2; i < n; ++i) {
116 | val = prev1 + prev2;
117 | prev2 = prev1;
118 | prev1 = val;
119 | }
120 |
121 | return val;
122 | }
123 |
124 | public static int [] getDigits(long a)
125 | {
126 | return getDigits(a, 1);
127 | }
128 |
129 | public static int [] getDigitsInTwos(long a)
130 | {
131 | return getDigits(a, 2);
132 | }
133 |
134 | public static int [] getDigitsInThrees(long a)
135 | {
136 | return getDigits(a, 3);
137 | }
138 |
139 | public static int getDigitsPowSum(int a)
140 | {
141 | int n = countDigits(a);
142 | int total = 0;
143 |
144 | while (a != 0) {
145 | total += pow(a % 10, n);
146 | a /= 10;
147 | }
148 |
149 | return total;
150 | }
151 |
152 | public static int getHardyRamanujanPairCount(int a)
153 | {
154 | int count = 0;
155 |
156 | EXIT_LOOP:
157 | for (int x = 1; x * x * x < a; ++x)
158 | for (int y = x + 1; x * x * x + y * y * y <= a; ++y) {
159 | if (x * x * x + y * y * y == a) {
160 | if (++count == 2)
161 | break EXIT_LOOP;
162 |
163 | ++x;
164 | }
165 | }
166 | return count;
167 | }
168 |
169 | public static int getPrime(int n)
170 | {
171 | int count = 0;
172 | int val = 2;
173 |
174 | for (;;) {
175 | if (isPrime(val))
176 | ++count;
177 |
178 | if (count == n)
179 | return val;
180 |
181 | ++val;
182 | }
183 | }
184 |
185 | public static int indexOfPrime(long a)
186 | {
187 | int i = 1;
188 | long val = 2;
189 |
190 | for (;;) {
191 | if (val == a)
192 | return i;
193 |
194 | if (isPrime(val))
195 | ++i;
196 |
197 | ++val;
198 | }
199 | }
200 | public static boolean isArmstrong(int a)
201 | {
202 | return a >= 0 && getDigitsPowSum(a) == a;
203 | }
204 |
205 | public static boolean isDecimalHarshad(int a)
206 | {
207 | return a > 0 && a % digitsSum(a) == 0;
208 | }
209 |
210 | public static boolean isHardyRamanujan(int a)
211 | {
212 | return a > 0 && getHardyRamanujanPairCount(a) == 2;
213 | }
214 |
215 | public static boolean isPerfect(int a)
216 | {
217 | return sumFactors(a) == a;
218 | }
219 |
220 | public static boolean isPrime(long a)
221 | {
222 | if (a <= 1)
223 | return false;
224 |
225 | if (a % 2 == 0)
226 | return a == 2;
227 |
228 | if (a % 3 == 0)
229 | return a == 3;
230 |
231 | if (a % 5 == 0)
232 | return a == 5;
233 |
234 | if (a % 7 == 0)
235 | return a == 7;
236 |
237 | for (long i = 11; i * i <= a; i += 2)
238 | if (a % i == 0)
239 | return false;
240 |
241 | return true;
242 | }
243 |
244 | public static boolean isSuperPrime(long a)
245 | {
246 | return isPrime(a) && isPrime(indexOfPrime(a));
247 | }
248 |
249 | public static int max(int a, int b, int c)
250 | {
251 | return Math.max(Math.max(a, b), c);
252 | }
253 |
254 | public static int mid(int a, int b, int c)
255 | {
256 | if (a <= b && b <= c || c <= b && b <= a)
257 | return b;
258 |
259 | if (b <= a && a <= c || c <= a && a <= b)
260 | return a;
261 |
262 | return c;
263 | }
264 |
265 | public static int min(int a, int b, int c)
266 | {
267 | return Math.min(Math.min(a, b), c);
268 | }
269 |
270 | public static void printCollatz(int n)
271 | {
272 | if (n <= 0) {
273 | System.out.println("Geçersiz sayı");
274 | return;
275 | }
276 |
277 | System.out.println(n);
278 |
279 | while (n != 1)
280 | System.out.println(n = (n % 2 == 0) ? (n / 2) : (3 * n + 1));
281 | }
282 |
283 | public static void printGoldBach(int val)
284 | {
285 | for (int a = 2; a < val; ++a) {
286 | int b = val - a;
287 |
288 | if (isPrime(a) && isPrime(b) && a <= b)
289 | System.out.printf("%d + %d = %d == %d%n", a, b, a + b, val);
290 | }
291 | }
292 |
293 | public static int sumFactors(int a)
294 | {
295 | if (a == 1)
296 | return 1;
297 |
298 | int result = 0;
299 | int sqrtVal = (int)sqrt(a);
300 |
301 | for (int i = 2; i <= sqrtVal; ++i)
302 | if (a % i == 0)
303 | result += (i == a / i) ? i : (i + a / i);
304 |
305 | return result + 1;
306 | }
307 | }
308 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/string/StringUtil.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : StringUtil.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 13.11.2022
5 |
6 | Utility class for string operations
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.string;
12 |
13 | import org.csystem.util.array.ArrayUtil;
14 |
15 | import java.util.ArrayList;
16 | import java.util.Random;
17 |
18 | public final class StringUtil {
19 | private static final String ALPHABET_TR;
20 | private static final String ALPHABET_EN;
21 | private static final String ALPHABET_CAPITAL_TR;
22 | private static final String ALPHABET_CAPITAL_EN;
23 | private static final String ALPHABET_ALL_TR;
24 | private static final String ALPHABET_ALL_EN;
25 |
26 | static {
27 | ALPHABET_TR = "abcçdefgğhıijklmnoöprsştuüvyz";
28 | ALPHABET_EN = "abcdefghijklmnopqrstuwxvyz";
29 | ALPHABET_CAPITAL_TR = "ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ";
30 | ALPHABET_CAPITAL_EN = "ABCDEFGHIJKLMNOPQRSTUWXVYZ";
31 | ALPHABET_ALL_TR = ALPHABET_TR + ALPHABET_CAPITAL_TR;
32 | ALPHABET_ALL_EN = ALPHABET_EN + ALPHABET_CAPITAL_EN;
33 | }
34 |
35 | private StringUtil()
36 | {
37 | }
38 |
39 | public static String capitalizeWS(String s)
40 | {
41 | int i;
42 | int len = s.length();
43 |
44 | for (i = 0; i < len && Character.isWhitespace(s.charAt(i)); ++i)
45 | ;
46 |
47 | return i == len ? s : s.substring(0, i) + Character.toUpperCase(s.charAt(i)) + s.substring(i + 1).toLowerCase();
48 | }
49 |
50 | public static String changeCase(String s)
51 | {
52 | char [] c = s.toCharArray();
53 |
54 | for (int i = 0; i < c.length; ++i)
55 | c[i] = Character.isLowerCase(c[i]) ? Character.toUpperCase(c[i]) : Character.toLowerCase(c[i]);
56 |
57 | return String.valueOf(c);
58 | }
59 |
60 | public static int countString(String s1, String s2)
61 | {
62 | int count = 0;
63 |
64 | for (int i = -1; (i = s1.indexOf(s2, i + 1)) != -1; ++count)
65 | ;
66 |
67 | return count;
68 | }
69 |
70 | public static int countStringIgnoreCase(String s1, String s2)
71 | {
72 | return countString(s1.toLowerCase(), s2.toLowerCase());
73 | }
74 |
75 | public static String getLastLongestPalindrome(String s)
76 | {
77 | String result = "";
78 |
79 | int end = s.length();
80 |
81 | while (end != 0) {
82 | int begin = 0;
83 |
84 | while (begin != end) {
85 | String str = s.substring(begin++, end);
86 |
87 | if (str.length() > 1 && isPalindrome(str) && result.length() < str.length())
88 | result = str;
89 | }
90 |
91 | --end;
92 | }
93 |
94 | return result;
95 | }
96 |
97 | public static String getRandomText(Random r, int n, String sourceText)
98 | {
99 | char [] c = new char[n];
100 | int len = sourceText.length();
101 |
102 | for (int i = 0; i < n; ++i)
103 | c[i] = sourceText.charAt(r.nextInt(len));
104 |
105 | return String.valueOf(c);
106 | }
107 |
108 | public static String getRandomTextEN(Random r, int n)
109 | {
110 | return getRandomText(r, n, ALPHABET_ALL_EN);
111 | }
112 |
113 | public static String getRandomTextEN(int n)
114 | {
115 | return getRandomTextTR(new Random(), n);
116 | }
117 |
118 | public static String getRandomTextTR(Random r, int n)
119 | {
120 | return getRandomText(r, n, ALPHABET_ALL_TR);
121 | }
122 |
123 | public static String getRandomTextTR(int n)
124 | {
125 | return getRandomTextTR(new Random(), n);
126 | }
127 |
128 | public static String [] getRandomTextsEN(int count, int min, int max)
129 | {
130 | return getRandomTextsEN(new Random(), count, min, max);
131 | }
132 |
133 | public static String [] getRandomTextsEN(Random r, int count, int min, int max)
134 | {
135 | String [] result = new String[count];
136 |
137 | for (int i = 0; i < count; ++i)
138 | result[i] = getRandomTextEN(r, r.nextInt(min, max + 1));
139 |
140 | return result;
141 | }
142 |
143 | public static String [] getRandomTextsTR(int count, int min, int max)
144 | {
145 | return getRandomTextsTR(new Random(), count, min, max);
146 | }
147 |
148 | public static String [] getRandomTextsTR(Random r, int count, int min, int max)
149 | {
150 | String [] result = new String[count];
151 |
152 | for (int i = 0; i < count; ++i)
153 | result[i] = getRandomTextTR(r, r.nextInt(min, max + 1));
154 |
155 | return result;
156 | }
157 |
158 | public static boolean isPalindrome(String s)
159 | {
160 | int left = 0;
161 | int right = s.length() - 1;
162 |
163 | while (left < right) {
164 | char cLeft = Character.toLowerCase(s.charAt(left));
165 |
166 | if (!Character.isLetter(cLeft)) {
167 | ++left;
168 | continue;
169 | }
170 |
171 | char cRight = Character.toLowerCase(s.charAt(right));
172 |
173 | if (!Character.isLetter(cRight)) {
174 | --right;
175 | continue;
176 | }
177 |
178 | if (cLeft != cRight)
179 | return false;
180 |
181 | ++left;
182 | --right;
183 | }
184 |
185 | return true;
186 | }
187 |
188 | public static boolean isPangram(String s, String alphabet)
189 | {
190 | int len = alphabet.length();
191 |
192 | for (int i = 0; i < len; ++i)
193 | if (!s.contains(alphabet.charAt(i) + ""))
194 | return false;
195 |
196 | return true;
197 | }
198 |
199 | public static boolean isPangramEN(String s)
200 | {
201 | return isPangram(s.toLowerCase(), ALPHABET_EN);
202 | }
203 |
204 | public static boolean isPangramTR(String s)
205 | {
206 | return isPangram(s.toLowerCase(), ALPHABET_TR);
207 | }
208 |
209 | public static String join(String [] s, char delimiter)
210 | {
211 | return join(s, delimiter + "");
212 | }
213 |
214 | public static String join(String [] s, char delimiter, boolean removeEmpties)
215 | {
216 | return join(s, delimiter + "", removeEmpties);
217 | }
218 |
219 | public static String join(String [] s, String delimiter)
220 | {
221 | return String.join(delimiter, s);
222 | }
223 |
224 | public static String join(String [] s, String delimiter, boolean removeEmpties)
225 | {
226 | String str = "";
227 |
228 | for (String sVal : s) {
229 | if (removeEmpties && sVal.isBlank())
230 | continue;
231 |
232 | str += sVal + delimiter;
233 | }
234 |
235 | return str.substring(0, str.length() - delimiter.length());
236 | }
237 |
238 | public static String join(ArrayList list, String delimiter)
239 | {
240 | return join(list, delimiter, false);
241 | }
242 |
243 | public static String join(ArrayList list, char delimiter)
244 | {
245 | return join(list, delimiter, false);
246 | }
247 |
248 | public static String join(ArrayList list, char delimiter, boolean removeEmpties)
249 | {
250 | return join(list, delimiter + "", removeEmpties);
251 | }
252 |
253 | public static String join(ArrayList list, String delimiter, boolean removeEmpties)
254 | {
255 | String str = "";
256 |
257 | for (Object o : list) {
258 | String s = (String)o;
259 |
260 | if (removeEmpties && s.isBlank())
261 | continue;
262 |
263 | str += s + delimiter;
264 | }
265 | return str.substring(0, str.length() - delimiter.length());
266 | }
267 |
268 | public static String padLeading(String s, int len, char ch)
269 | {
270 | int length = s.length();
271 |
272 | return len <= length ? s : (ch + "").repeat(len - length) + s;
273 | }
274 |
275 | public static String padLeading(String s, int len)
276 | {
277 | return padLeading(s, len, ' ');
278 | }
279 |
280 | public static String padTrailing(String s, int len, char ch)
281 | {
282 | int length = s.length();
283 |
284 | return len <= length ? s : (ch + "").repeat(len - length);
285 | }
286 |
287 | public static String padTrailing(String s, int len)
288 | {
289 | return padTrailing(s, len, ' ');
290 | }
291 |
292 | public static String reverse(String str)
293 | {
294 | char [] c = str.toCharArray();
295 |
296 | ArrayUtil.reverse(c);
297 |
298 | return String.valueOf(c);
299 | }
300 |
301 | public static String squeeze(String s1, String s2)
302 | {
303 | int len = s1.length();
304 | char [] c = new char[len];
305 | int idx = 0;
306 |
307 | for (int i = 0; i < len; ++i) {
308 | char ch = s1.charAt(i);
309 |
310 | if (!s2.contains(ch + ""))
311 | c[idx++] = ch;
312 | }
313 |
314 | return String.valueOf(c, 0, idx);
315 | }
316 | public static String squeezeIgnoreCase(String s1, String s2)
317 | {
318 | return squeeze(s1.toLowerCase(), s2.toLowerCase());
319 | }
320 | }
321 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/tuple/Pair.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Pair.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 06.11.2022
5 |
6 | Immutable Pair class that represents a Tuple
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.tuple;
12 |
13 | public class Pair {
14 | private final F m_first;
15 | private final S m_second;
16 |
17 | public static Pair of(F first, S second)
18 | {
19 | return new Pair<>(first, second);
20 | }
21 |
22 | public Pair()
23 | {
24 | this(null, null);
25 | }
26 |
27 | public Pair(F first, S second)
28 | {
29 | m_first = first;
30 | m_second = second;
31 | }
32 |
33 | public F getFirst()
34 | {
35 | return m_first;
36 | }
37 |
38 | public S getSecond()
39 | {
40 | return m_second;
41 | }
42 |
43 | public String toString()
44 | {
45 | return String.format("(%s, %s)", m_first, m_second);
46 | }
47 |
48 | //...
49 | }
50 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/tuple/Triple.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Triple.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 06.11.2022
5 |
6 | Immutable Triple class that represents a Tuple
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.tuple;
12 |
13 | public class Triple {
14 | private final F m_first;
15 | private final S m_second;
16 | private final T m_third;
17 |
18 | public static Triple of(F first, S second, T third)
19 | {
20 | return new Triple<>(first, second, third);
21 | }
22 |
23 | public Triple()
24 | {
25 | this(null, null, null);
26 | }
27 |
28 | public Triple(F first, S second, T third)
29 | {
30 | m_first = first;
31 | m_second = second;
32 | m_third = third;
33 | }
34 |
35 | public F getFirst()
36 | {
37 | return m_first;
38 | }
39 |
40 | public S getSecond()
41 | {
42 | return m_second;
43 | }
44 |
45 | public T getThird()
46 | {
47 | return m_third;
48 | }
49 |
50 | public String toString()
51 | {
52 | return String.format("(%s, %s, %s)", m_first, m_second, m_third);
53 | }
54 |
55 | //...
56 | }
57 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/tuple/Value.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : Value.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 06.11.2022
5 |
6 | Immutable Value class that represents a Tuple
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.tuple;
12 |
13 | public class Value {
14 | private final T m_value;
15 |
16 | public static Value of(T value)
17 | {
18 | return new Value<>(value);
19 | }
20 |
21 | public Value()
22 | {
23 | this(null);
24 | }
25 |
26 | public Value(T value)
27 | {
28 | m_value = value;
29 | }
30 |
31 | public T getValue()
32 | {
33 | return m_value;
34 | }
35 |
36 | public String toString()
37 | {
38 | return String.format("%s", m_value);
39 | }
40 |
41 | //...
42 | }
43 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/wrapper/IntValue.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : IntValue.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 27.08.2022
5 |
6 | Immutable IntValue class that wraps an int value by using cache
7 | for values in [-128, 127] closed interval
8 |
9 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
10 | All Rights Free
11 | -----------------------------------------------------------------------*/
12 | package org.csystem.util.wrapper;
13 |
14 | public final class IntValue {
15 | private static final int CACHE_MIN = -128;
16 | private static final int CACHE_MAX = 127;
17 | private static final IntValue [] CACHE = new IntValue[CACHE_MAX - CACHE_MIN + 1];
18 | private final int m_value;
19 |
20 | public static final IntValue ZERO = of(0);
21 | public static final IntValue ONE = of(1);
22 | public static final IntValue TWO = of(2);
23 | public static final IntValue TEN = of(10);
24 |
25 | private IntValue(int value)
26 | {
27 | m_value = value;
28 | }
29 |
30 | public static IntValue of(int value)
31 | {
32 | if (value < CACHE_MIN || CACHE_MAX < value)
33 | return new IntValue(value);
34 |
35 | int idx = value + 128;
36 |
37 | if (CACHE[idx] == null)
38 | CACHE[idx] = new IntValue(value);
39 |
40 | return CACHE[idx];
41 | }
42 |
43 | public int getValue()
44 | {
45 | return m_value;
46 | }
47 |
48 | public int compareTo(IntValue other)
49 | {
50 | return m_value - other.m_value;
51 | }
52 |
53 | public IntValue add(int value)
54 | {
55 | return of(m_value + value);
56 | }
57 |
58 | public IntValue add(IntValue value)
59 | {
60 | return add(value.m_value);
61 | }
62 |
63 | public IntValue subtract(int value)
64 | {
65 | return add(-value);
66 | }
67 |
68 | public IntValue subtract(IntValue value)
69 | {
70 | return subtract(value.m_value);
71 | }
72 |
73 | public IntValue multiply(int value)
74 | {
75 | return of(m_value * value);
76 | }
77 |
78 | public IntValue multiply(IntValue value)
79 | {
80 | return multiply(value.m_value);
81 | }
82 |
83 | public IntValue divide(int value)
84 | {
85 | return of(m_value / value);
86 | }
87 |
88 | public IntValue divide(IntValue value)
89 | {
90 | return divide(value.m_value);
91 | }
92 |
93 | public IntValue[] divideAndRemainder(int value)
94 | {
95 | IntValue [] result = new IntValue[2];
96 | result[0] = divide(value);
97 | result[1] = of(m_value % value);
98 |
99 | return result;
100 | }
101 |
102 | public IntValue [] divideAndRemainder(IntValue value)
103 | {
104 | return divideAndRemainder(value.m_value);
105 | }
106 |
107 | public IntValue mod(int value)
108 | {
109 | return of(m_value % value);
110 | }
111 |
112 | public IntValue mod(IntValue value)
113 | {
114 | return mod(value.m_value);
115 | }
116 |
117 | public IntValue inc()
118 | {
119 | return add(1);
120 | }
121 |
122 | public IntValue dec()
123 | {
124 | return subtract(1);
125 | }
126 |
127 | public String toString()
128 | {
129 | return m_value + "";
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/wrapper/LongValue.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : LongValue.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 27.08.2022
5 |
6 | Immutable LongValue class that wraps a long value by using cache
7 | for values in [-128, 127] closed interval
8 |
9 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
10 | All Rights Free
11 | -----------------------------------------------------------------------*/
12 | package org.csystem.util.wrapper;
13 |
14 | public final class LongValue {
15 | private static final int CACHE_MIN = -128;
16 | private static final int CACHE_MAX = 127;
17 | private static final LongValue[] CACHE = new LongValue[CACHE_MAX - CACHE_MIN + 1];
18 | private final long m_value;
19 |
20 | public static final LongValue ZERO = of(0);
21 | public static final LongValue ONE = of(1);
22 | public static final LongValue TWO = of(2);
23 | public static final LongValue TEN = of(10);
24 |
25 | private LongValue(long value)
26 | {
27 | m_value = value;
28 | }
29 |
30 | public static LongValue of(long value)
31 | {
32 | if (value < CACHE_MIN || CACHE_MAX < value)
33 | return new LongValue(value);
34 |
35 | int idx = (int)(value + 128);
36 |
37 | if (CACHE[idx] == null)
38 | CACHE[idx] = new LongValue(value);
39 |
40 | return CACHE[idx];
41 | }
42 |
43 | public long getValue()
44 | {
45 | return m_value;
46 | }
47 |
48 | public int compareTo(LongValue other)
49 | {
50 | long diff = m_value - other.m_value;
51 |
52 | if (diff > 0)
53 | return 1;
54 | if (diff < 0)
55 | return -1;
56 |
57 | return 0;
58 |
59 | }
60 |
61 | public LongValue add(long value)
62 | {
63 | return of(m_value + value);
64 | }
65 |
66 | public LongValue add(LongValue value)
67 | {
68 | return add(value.m_value);
69 | }
70 |
71 | public LongValue subtract(long value)
72 | {
73 | return add(-value);
74 | }
75 |
76 | public LongValue subtract(LongValue value)
77 | {
78 | return subtract(value.m_value);
79 | }
80 |
81 | public LongValue multiply(long value)
82 | {
83 | return of(m_value * value);
84 | }
85 |
86 | public LongValue multiply(LongValue value)
87 | {
88 | return multiply(value.m_value);
89 | }
90 |
91 | public LongValue divide(long value)
92 | {
93 | return of(m_value / value);
94 | }
95 |
96 | public LongValue divide(LongValue value)
97 | {
98 | return divide(value.m_value);
99 | }
100 |
101 | public LongValue[] divideAndRemainder(long value)
102 | {
103 | LongValue[] result = new LongValue[2];
104 | result[0] = divide(value);
105 | result[1] = of(m_value % value);
106 |
107 | return result;
108 | }
109 |
110 | public LongValue[] divideAndRemainder(LongValue value)
111 | {
112 | return divideAndRemainder(value.m_value);
113 | }
114 |
115 | public LongValue mod(long value)
116 | {
117 | return of(m_value % value);
118 | }
119 |
120 | public LongValue mod(LongValue value)
121 | {
122 | return mod(value.m_value);
123 | }
124 |
125 | public LongValue inc()
126 | {
127 | return add(1);
128 | }
129 |
130 | public LongValue dec()
131 | {
132 | return subtract(1);
133 | }
134 |
135 | public String toString()
136 | {
137 | return m_value + "";
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/src/Sample/src/org/csystem/util/wrapper/MutableIntValue.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------
2 | FILE : IntValue.java
3 | AUTHOR : Java-Feb-2022 Group
4 | LAST UPDATE : 02.09.2022
5 |
6 | MutableImmutable IntValue class that wraps an int value
7 |
8 | Copyleft (c) 1993 by C and System Programmers Association (CSD)
9 | All Rights Free
10 | -----------------------------------------------------------------------*/
11 | package org.csystem.util.wrapper;
12 |
13 | public final class MutableIntValue {
14 | private int m_value;
15 |
16 | public MutableIntValue()
17 | {
18 | }
19 |
20 | public MutableIntValue(int value)
21 | {
22 | m_value = value;
23 | }
24 |
25 |
26 | public int getValue()
27 | {
28 | return m_value;
29 | }
30 |
31 | public MutableIntValue setValue(int value)
32 | {
33 | m_value = value;
34 |
35 | return this;
36 | }
37 |
38 | public int compareTo(MutableIntValue other)
39 | {
40 | return m_value - other.m_value;
41 | }
42 |
43 | public MutableIntValue add(int value)
44 | {
45 | m_value += value;
46 | return this;
47 | }
48 |
49 | public MutableIntValue add(MutableIntValue value)
50 | {
51 | return add(value.m_value);
52 | }
53 |
54 | public MutableIntValue subtract(int value)
55 | {
56 | return add(-value);
57 | }
58 |
59 | public MutableIntValue subtract(MutableIntValue value)
60 | {
61 | return subtract(value.m_value);
62 | }
63 |
64 | public MutableIntValue multiply(int value)
65 | {
66 | m_value *= value;
67 | return this;
68 | }
69 |
70 | public MutableIntValue multiply(MutableIntValue value)
71 | {
72 | return multiply(value.m_value);
73 | }
74 |
75 | public MutableIntValue divide(int value)
76 | {
77 | m_value /= value;
78 |
79 | return this;
80 | }
81 |
82 | public MutableIntValue divide(MutableIntValue value)
83 | {
84 | return divide(value.m_value);
85 | }
86 |
87 | public MutableIntValue[] divideAndRemainder(int value)
88 | {
89 | MutableIntValue[] result = new MutableIntValue[2];
90 | result[0] = divide(value);
91 | result[1] = new MutableIntValue(m_value % value);
92 |
93 | return result;
94 | }
95 |
96 | public MutableIntValue[] divideAndRemainder(MutableIntValue value)
97 | {
98 | return divideAndRemainder(value.m_value);
99 | }
100 |
101 | public MutableIntValue mod(int value)
102 | {
103 | m_value %= value;
104 |
105 | return this;
106 | }
107 |
108 | public MutableIntValue mod(MutableIntValue value)
109 | {
110 | return mod(value.m_value);
111 | }
112 |
113 | public MutableIntValue inc()
114 | {
115 | return add(1);
116 | }
117 |
118 | public MutableIntValue dec()
119 | {
120 | return subtract(1);
121 | }
122 |
123 | public String toString()
124 | {
125 | return m_value + "";
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/src-console/csd/App.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/src-console/csd/App.class
--------------------------------------------------------------------------------
/src/src-console/csd/App.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 |
3 | ----------------------------------------------------------------------------------------------------------------------*/
4 | package csd;
5 |
6 | public class App {
7 | public static void main(String [] args)
8 | {
9 | System.out.println("Hello I am App");
10 | msd.Sample.main(args);
11 | }
12 | }
13 |
14 |
15 | class Test {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/src-console/csd/Test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/src-console/csd/Test.class
--------------------------------------------------------------------------------
/src/src-console/msd/Sample.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oguzkaran/Java-Feb-2022/062d1088fe9e1a98cc58c2e5a95fbd3f0002db6e/src/src-console/msd/Sample.class
--------------------------------------------------------------------------------
/src/src-console/msd/Sample.java:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------------------------------------------------------------
2 |
3 | ----------------------------------------------------------------------------------------------------------------------*/
4 | package msd;
5 |
6 | class ample {
7 | //...
8 |
9 | public static void main(String [] args)
10 | {
11 | System.out.println("Hello I am Sample");
12 | }
13 |
14 | public Sample()
15 | {
16 | System.out.println("I am default ctor");
17 | }
18 |
19 | public void foo()
20 | {
21 | System.out.println("Sample.foo");
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------