├── Links.txt ├── README.md ├── doc ├── Examples.txt ├── figures │ ├── ikinci-dereceden-denklem.jpg │ └── test.bmp ├── 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-Koşul-Operatörü-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-Java-001.pdf ├── Homework-Java-002.pdf ├── Homework-Java-003.pdf ├── Homework-Java-004.pdf ├── Homework-Java-005.pdf ├── Homework-Java-006.pdf ├── Homework-Java-007.pdf ├── Homework-Java-008.pdf ├── Homework-Java-009.pdf ├── Homework-Java-010.pdf ├── Homework-Java-011.pdf ├── Homework-Java-012.pdf ├── Homework-Java-013.pdf ├── Homework-Java-014.pdf ├── Homework-Java-015.pdf ├── Homework-Java-016.pdf ├── Homework-Java-017.pdf ├── Homework-Java-018.pdf ├── Homework-Java-019.pdf ├── Homework-Java-020.pdf ├── images.txt └── sudoku.txt └── src ├── Sample ├── .idea │ ├── .gitignore │ ├── codeStyles │ │ └── codeStyleConfig.xml │ ├── misc.xml │ ├── modules.xml │ ├── uiDesigner.xml │ └── vcs.xml ├── Sample.iml ├── out │ └── production │ │ └── Sample │ │ └── org │ │ └── csystem │ │ ├── app │ │ ├── App.class │ │ ├── Util.class │ │ ├── factory │ │ │ └── fraction │ │ │ │ └── RandomFractionFactory.class │ │ └── io │ │ │ └── file │ │ │ ├── ReaderApp.class │ │ │ └── WriterApp.class │ │ ├── application │ │ ├── ballfall │ │ │ ├── BallFall.class │ │ │ └── BallFallGameApp.class │ │ ├── calculatesumcountminmaxaverage │ │ │ ├── CalculateSumCountMaxMinAverageApp.class │ │ │ ├── SumCountMaxMinAverage.class │ │ │ └── SumCountMaxMinAverageOperation.class │ │ ├── company │ │ │ ├── CompanyApp.class │ │ │ ├── Employee.class │ │ │ ├── HumanResources.class │ │ │ ├── Manager.class │ │ │ ├── ProjectWorker.class │ │ │ ├── SalesManager.class │ │ │ └── Worker.class │ │ ├── date │ │ │ └── DateApp.class │ │ ├── device │ │ │ ├── Device.class │ │ │ ├── DeviceMenuApp.class │ │ │ ├── DeviceMenuRunner.class │ │ │ ├── DevicePersistence.class │ │ │ └── DeviceRecord.class │ │ ├── devices │ │ │ ├── DeviceFactory.class │ │ │ ├── DeviceInfo.class │ │ │ ├── DevicesApp.class │ │ │ └── StoreDevicesToArrayApp.class │ │ ├── exam │ │ │ ├── ExamSimulation.class │ │ │ └── ExamSimulationApp.class │ │ ├── findtextincurly │ │ │ ├── FindTextInCurly.class │ │ │ └── FindTextIntCurlyApp.class │ │ ├── io │ │ │ └── file │ │ │ │ ├── FileDeleteApp.class │ │ │ │ ├── FileListApp.class │ │ │ │ ├── ListDirectoryContentsApp.class │ │ │ │ ├── copy │ │ │ │ ├── BackupAndCopy.class │ │ │ │ ├── BackupAndCopyApp.class │ │ │ │ ├── ConcatFiles.class │ │ │ │ ├── ConcatFilesApp.class │ │ │ │ ├── CopyFile.class │ │ │ │ └── CopyFileApp.class │ │ │ │ ├── filecompare │ │ │ │ └── FileCompareApp.class │ │ │ │ ├── image │ │ │ │ └── bitmap │ │ │ │ │ └── DIBWindowsApp.class │ │ │ │ ├── ncharacters │ │ │ │ ├── NumberOfCharacterInFile.class │ │ │ │ └── NumberOfCharacterInFileApp.class │ │ │ │ └── randomaccess │ │ │ │ ├── RandomAccessFileWriteFromStdIn.class │ │ │ │ └── RandomAccessFileWriteFromStdInApp.class │ │ ├── lotto │ │ │ ├── Lotto.class │ │ │ ├── LottoProbabilitySimulation.class │ │ │ └── LottoProbabilitySimulationApp.class │ │ ├── numericlottery │ │ │ ├── NumericLottery.class │ │ │ └── NumericLotteryApp.class │ │ ├── parser │ │ │ ├── CharArraySource.class │ │ │ ├── DigitParser.class │ │ │ ├── DigitParserStdInSourceApp.class │ │ │ ├── FileAsciiSource.class │ │ │ ├── FileSource.class │ │ │ ├── FileUTFSource.class │ │ │ ├── ISource.class │ │ │ ├── LetterParser.class │ │ │ ├── LetterParserFileAsciiSourceApp.class │ │ │ ├── LetterParserFileSourceApp.class │ │ │ ├── ParseFactory$1.class │ │ │ ├── ParseFactory.class │ │ │ ├── Parser.class │ │ │ ├── ParserType.class │ │ │ ├── StringSource.class │ │ │ ├── WhitespaceParser.class │ │ │ └── WhitespaceParserStdInSourceApp.class │ │ ├── randomgenerator │ │ │ ├── RandomObjectArrayFactory.class │ │ │ └── RandomObjectArrayGeneratorApp.class │ │ └── studentinfoparser │ │ │ ├── StudentInfo.class │ │ │ ├── StudentInfoParser.class │ │ │ └── StudentInfoParserApp.class │ │ └── util │ │ ├── array │ │ └── ArrayUtil.class │ │ ├── collection │ │ └── CSDArrayList.class │ │ ├── console │ │ ├── CommandLineUtil.class │ │ └── Console.class │ │ ├── converter │ │ └── BitConverter.class │ │ ├── datetime │ │ ├── Date.class │ │ ├── DateTime.class │ │ ├── DateTimeException.class │ │ ├── DayOfWeek.class │ │ ├── Month.class │ │ └── Time.class │ │ ├── image │ │ ├── AbstractImage.class │ │ ├── IIMage.class │ │ └── bitmap │ │ │ └── DIBWindows.class │ │ ├── io │ │ └── file │ │ │ └── FileUtil.class │ │ ├── math │ │ ├── Complex.class │ │ ├── Fraction.class │ │ ├── OperationStatus.class │ │ ├── OperationStatusException.class │ │ └── geometry │ │ │ ├── AnalyticalCircle.class │ │ │ ├── Circle.class │ │ │ ├── CoordinateType.class │ │ │ └── Point.class │ │ ├── number │ │ └── NumberUtil.class │ │ ├── string │ │ └── StringUtil.class │ │ ├── system │ │ └── SystemUtil.class │ │ ├── tuple │ │ ├── Pair.class │ │ ├── Triple.class │ │ └── Value.class │ │ └── wrapper │ │ ├── IntValue.class │ │ └── MutableIntValue.class └── src │ └── org │ └── csystem │ ├── app │ ├── App.java │ ├── factory │ │ └── fraction │ │ │ └── RandomFractionFactory.java │ └── io │ │ └── file │ │ ├── ReaderApp.java │ │ └── WriterApp.java │ ├── application │ ├── ballfall │ │ ├── BallFall.java │ │ └── BallFallGameApp.java │ ├── calculatesumcountminmaxaverage │ │ ├── CalculateSumCountMaxMinAverageApp.java │ │ ├── SumCountMaxMinAverage.java │ │ └── SumCountMaxMinAverageOperation.java │ ├── company │ │ ├── CompanyApp.java │ │ ├── Employee.java │ │ ├── HumanResources.java │ │ ├── Manager.java │ │ ├── ProjectWorker.java │ │ ├── SalesManager.java │ │ └── Worker.java │ ├── date │ │ └── DateApp.java │ ├── device │ │ ├── Device.java │ │ ├── DeviceMenuApp.java │ │ ├── DeviceMenuRunner.java │ │ ├── DevicePersistence.java │ │ └── DeviceRecord.java │ ├── devices │ │ ├── DeviceFactory.java │ │ ├── DeviceInfo.java │ │ ├── DevicesApp.java │ │ └── StoreDevicesToArrayApp.java │ ├── exam │ │ ├── ExamSimulation.java │ │ └── ExamSimulationApp.java │ ├── findtextincurly │ │ ├── FindTextInCurly.java │ │ └── FindTextIntCurlyApp.java │ ├── io │ │ └── file │ │ │ ├── FileDeleteApp.java │ │ │ ├── FileListApp.java │ │ │ ├── ListDirectoryContentsApp.java │ │ │ ├── copy │ │ │ ├── BackupAndCopy.java │ │ │ ├── BackupAndCopyApp.java │ │ │ ├── ConcatFiles.java │ │ │ ├── ConcatFilesApp.java │ │ │ ├── CopyFile.java │ │ │ └── CopyFileApp.java │ │ │ ├── filecompare │ │ │ └── FileCompareApp.java │ │ │ ├── image │ │ │ └── bitmap │ │ │ │ └── DIBWindowsApp.java │ │ │ ├── ncharacters │ │ │ ├── NumberOfCharacterInFile.java │ │ │ └── NumberOfCharacterInFileApp.java │ │ │ └── randomaccess │ │ │ ├── RandomAccessFileWriteFromStdIn.java │ │ │ └── RandomAccessFileWriteFromStdInApp.java │ ├── lotto │ │ ├── Lotto.java │ │ ├── LottoProbabilitySimulation.java │ │ └── LottoProbabilitySimulationApp.java │ ├── numericlottery │ │ ├── NumericLottery.java │ │ └── NumericLotteryApp.java │ ├── parser │ │ ├── CharArraySource.java │ │ ├── DigitParser.java │ │ ├── DigitParserStdInSourceApp.java │ │ ├── FileAsciiSource.java │ │ ├── FileSource.java │ │ ├── FileUTFSource.java │ │ ├── ISource.java │ │ ├── LetterParser.java │ │ ├── LetterParserFileAsciiSourceApp.java │ │ ├── LetterParserFileSourceApp.java │ │ ├── ParseFactory.java │ │ ├── Parser.java │ │ ├── ParserType.java │ │ ├── StringSource.java │ │ ├── WhitespaceParser.java │ │ └── WhitespaceParserStdInSourceApp.java │ ├── randomgenerator │ │ ├── RandomObjectArrayFactory.java │ │ └── RandomObjectArrayGeneratorApp.java │ └── studentinfoparser │ │ ├── StudentInfo.java │ │ ├── StudentInfoParser.java │ │ └── StudentInfoParserApp.java │ └── util │ ├── array │ └── ArrayUtil.java │ ├── collection │ └── CSDArrayList.java │ ├── console │ ├── CommandLineUtil.java │ └── Console.java │ ├── converter │ └── BitConverter.java │ ├── datetime │ ├── Date.java │ ├── DateTime.java │ ├── DateTimeException.java │ ├── DayOfWeek.java │ ├── Month.java │ └── Time.java │ ├── image │ ├── AbstractImage.java │ ├── IIMage.java │ └── bitmap │ │ └── DIBWindows.java │ ├── io │ └── file │ │ └── FileUtil.java │ ├── math │ ├── Complex.java │ ├── Fraction.java │ ├── OperationStatus.java │ ├── OperationStatusException.java │ └── geometry │ │ ├── AnalyticalCircle.java │ │ ├── Circle.java │ │ └── Point.java │ ├── number │ └── NumberUtil.java │ ├── string │ └── StringUtil.java │ ├── system │ └── SystemUtil.java │ ├── tuple │ ├── Pair.java │ ├── Triple.java │ └── Value.java │ └── wrapper │ ├── IntValue.java │ └── MutableIntValue.java └── src-console ├── csd ├── App.class └── App.java └── msd ├── Mample.class ├── Mample.java ├── Sample.class └── Sample.java /Links.txt: -------------------------------------------------------------------------------- 1 | Link : https://www.dropbox.com/sh/75a40td2o3y498e/AABnAgcTp73i5qRlqccr1aPba?dl=0 2 | Kısa Link : http://bit.do/java-nov-2020 3 | Github : https://github.com/oguzkaran/Java-Nov-2020 4 | 5 | 6 | İletişim Bilgileri: 7 | Oğuz Karan 8 | Email : oguzkaran@csystem.org 9 | Tel : 05325158012 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java-Nov-2020 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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/Examples.txt -------------------------------------------------------------------------------- /doc/figures/ikinci-dereceden-denklem.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/figures/ikinci-dereceden-denklem.jpg -------------------------------------------------------------------------------- /doc/figures/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/figures/test.bmp -------------------------------------------------------------------------------- /doc/notes/001-Temel-Kavramlar-V4.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/001-Temel-Kavramlar-V4.0.pdf -------------------------------------------------------------------------------- /doc/notes/002-Turler-Bildirim-V2.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/002-Turler-Bildirim-V2.2.pdf -------------------------------------------------------------------------------- /doc/notes/003-Metotlar-V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/003-Metotlar-V1.1.pdf -------------------------------------------------------------------------------- /doc/notes/004-Sabitler-V2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/004-Sabitler-V2.0.pdf -------------------------------------------------------------------------------- /doc/notes/005-Temel-Operatorler-V2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/005-Temel-Operatorler-V2.0.pdf -------------------------------------------------------------------------------- /doc/notes/006-Deyimler-V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/006-Deyimler-V1.1.pdf -------------------------------------------------------------------------------- /doc/notes/007-if-deyimi-V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/009-for-Donguleri-V2.0.pdf -------------------------------------------------------------------------------- /doc/notes/010-break-Deyimi-V1.0 .pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/010-break-Deyimi-V1.0 .pdf -------------------------------------------------------------------------------- /doc/notes/011-continue-Deyimi-V2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/011-continue-Deyimi-V2.0.pdf -------------------------------------------------------------------------------- /doc/notes/012-switch-Deyimi-V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/012-switch-Deyimi-V1.1.pdf -------------------------------------------------------------------------------- /doc/notes/013-Tur-Donusumleri-V2.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/013-Tur-Donusumleri-V2.2.pdf -------------------------------------------------------------------------------- /doc/notes/014-Koşul-Operatörü-V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/014-Koşul-Operatörü-V1.0.pdf -------------------------------------------------------------------------------- /doc/notes/015-Method-Overloading-V1.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/015-Method-Overloading-V1.2.pdf -------------------------------------------------------------------------------- /doc/notes/016-NYPT-Adres-Kavramı-V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/016-NYPT-Adres-Kavramı-V1.1.pdf -------------------------------------------------------------------------------- /doc/notes/017-Sınflarin-Elemanları-V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/017-Sınflarin-Elemanları-V1.0.pdf -------------------------------------------------------------------------------- /doc/notes/018-Rastgele-Sayi-Uretilmesi-V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/018-Rastgele-Sayi-Uretilmesi-V1.0.pdf -------------------------------------------------------------------------------- /doc/notes/019-Siniflarin-Baslangic-Metotlari.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/notes/019-Siniflarin-Baslangic-Metotlari.pdf -------------------------------------------------------------------------------- /doc/notes/020-String-Sınıfı-V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/doc/setup-notes/Windows'ta Java'nın Kurulumu.docx -------------------------------------------------------------------------------- /homeworks/Homework-Java-001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-001.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-002.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-002.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-003.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-003.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-004.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-004.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-005.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-005.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-006.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-006.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-007.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-007.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-008.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-008.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-009.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-009.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-010.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-010.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-011.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-011.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-012.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-012.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-013.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-013.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-014.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-014.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-015.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-015.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-016.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-017.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-018.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-018.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-019.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-019.pdf -------------------------------------------------------------------------------- /homeworks/Homework-Java-020.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/homeworks/Homework-Java-020.pdf -------------------------------------------------------------------------------- /homeworks/images.txt: -------------------------------------------------------------------------------- 1 | 18 2 | .....X....X......................X....X..... 3 | ....XXX..XXX....................XXX..XXX.... 4 | ....XXX..XXX....................XXX..XXX.... 5 | ....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... 6 | ....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... 7 | ....XXXXXXXX....................XXXXXXXX.... 8 | ....XXXXXXXX....................XXXXXXXX.... 9 | ....XXXXXXXX....................XXXXXXXX.... 10 | ....XXXXXXXX....................XXXXXXXX.... 11 | ....XXXXXXXX....................XXXXXXXX.... 12 | ....XXXXXXXX....................XXXXXXXX.... 13 | ....XXXXXXXX....................XXXXXXXX.... 14 | ....XXXXXXXX....................XXXXXXXX.... 15 | ....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... 16 | ..XXXXXXXXXXXX................XXXXXXXXXXXX.. 17 | .XXXXXXXXXXXXXX..............XXXXXXXXXXXXXX. 18 | .XXXXXXXXXXXXXX..............XXXXXXXXXXXXXX. 19 | .XXXXXXXXXXXXXX..............XXXXXXXXXXXXXX. 20 | disp 21 | quit 22 | 23 | 24 | 24 25 | ........................................ 26 | ...................................MM... 27 | ..............................MMMMMM,... 28 | .........................,MMMMMMMMMM.... 29 | ....................,MMMMMMMMMMMMMM..... 30 | ................MMMMMMMMMMMMMMMMMMM..... 31 | ..................MMMMMMMMMMMMMMMM...... 32 | ...................MMMMMMMMMMMMMMM...... 33 | ..................MMMMMMMMMMMMMMM,...... 34 | ................+MMMMMMMMMMMMMMMM....... 35 | ...............MMMMMMMMMMMMMMMMM........ 36 | .............MMMMMMMMMMMMMMMMMMM........ 37 | ............MMMMMMMMMMMMMM.MMMM,........ 38 | ..........MMMMMMMMMMMMMM+....MM......... 39 | ........+MMMMMMMMMMMMMM................. 40 | .......MMMMMMMMMMMMMM................... 41 | .....MMMMMMMMMMMMMMM.................... 42 | ....MMMMMMMMMMMMMM...................... 43 | ..MMMMMMMMMMMMMM+....................... 44 | ..MMMMMMMMMMMMM......................... 45 | ....MMMMMMMMM........................... 46 | .....MMMMMMM............................ 47 | .......MMM.............................. 48 | ........................................ 49 | 50 | transpose 51 | disp 52 | quit 53 | 54 | 55 | 24 56 | ........................................ 57 | ...................................MM... 58 | ..............................MMMMMM,... 59 | .........................,MMMMMMMMMM.... 60 | ....................,MMMMMMMMMMMMMM..... 61 | ................MMMMMMMMMMMMMMMMMMM..... 62 | ..................MMMMMMMMMMMMMMMM...... 63 | ...................MMMMMMMMMMMMMMM...... 64 | ..................MMMMMMMMMMMMMMM,...... 65 | ................+MMMMMMMMMMMMMMMM....... 66 | ...............MMMMMMMMMMMMMMMMM........ 67 | .............MMMMMMMMMMMMMMMMMMM........ 68 | ............MMMMMMMMMMMMMM.MMMM,........ 69 | ..........MMMMMMMMMMMMMM+....MM......... 70 | ........+MMMMMMMMMMMMMM................. 71 | .......MMMMMMMMMMMMMM................... 72 | .....MMMMMMMMMMMMMMM.................... 73 | ....MMMMMMMMMMMMMM...................... 74 | ..MMMMMMMMMMMMMM+....................... 75 | ..MMMMMMMMMMMMM......................... 76 | ....MMMMMMMMM........................... 77 | .....MMMMMMM............................ 78 | .......MMM.............................. 79 | ........................................ 80 | flip-v 81 | disp 82 | quit 83 | 84 | -------------------------------------------------------------------------------- /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/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /src/Sample/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Sample/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/app/App.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/app/Util.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/app/Util.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/app/factory/fraction/RandomFractionFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/app/factory/fraction/RandomFractionFactory.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/app/io/file/ReaderApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/app/io/file/ReaderApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/app/io/file/WriterApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/app/io/file/WriterApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/ballfall/BallFall.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/ballfall/BallFall.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/ballfall/BallFallGameApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/ballfall/BallFallGameApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/CalculateSumCountMaxMinAverageApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/CalculateSumCountMaxMinAverageApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverage.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverageOperation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverageOperation.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/CompanyApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/CompanyApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/Employee.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/Employee.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/HumanResources.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/HumanResources.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/Manager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/Manager.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/ProjectWorker.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/ProjectWorker.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/SalesManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/SalesManager.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/company/Worker.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/company/Worker.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/date/DateApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/date/DateApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/device/Device.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/device/Device.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/device/DeviceMenuApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/device/DeviceMenuApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/device/DeviceMenuRunner.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/device/DeviceMenuRunner.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/device/DevicePersistence.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/device/DevicePersistence.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/device/DeviceRecord.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/device/DeviceRecord.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/devices/DeviceFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/devices/DeviceFactory.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/devices/DeviceInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/devices/DeviceInfo.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/devices/DevicesApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/devices/DevicesApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/devices/StoreDevicesToArrayApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/devices/StoreDevicesToArrayApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/exam/ExamSimulation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/exam/ExamSimulation.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/exam/ExamSimulationApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/exam/ExamSimulationApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/findtextincurly/FindTextInCurly.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/findtextincurly/FindTextInCurly.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/findtextincurly/FindTextIntCurlyApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/findtextincurly/FindTextIntCurlyApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/FileDeleteApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/FileDeleteApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/FileListApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/FileListApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/ListDirectoryContentsApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/ListDirectoryContentsApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/BackupAndCopy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/BackupAndCopy.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/BackupAndCopyApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/BackupAndCopyApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/ConcatFiles.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/ConcatFiles.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/ConcatFilesApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/ConcatFilesApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/CopyFile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/CopyFile.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/copy/CopyFileApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/copy/CopyFileApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/filecompare/FileCompareApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/filecompare/FileCompareApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/image/bitmap/DIBWindowsApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/image/bitmap/DIBWindowsApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFile.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFileApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFileApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdIn.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdIn.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdInApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdInApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/lotto/Lotto.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/lotto/Lotto.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/lotto/LottoProbabilitySimulation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/lotto/LottoProbabilitySimulation.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/lotto/LottoProbabilitySimulationApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/lotto/LottoProbabilitySimulationApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/numericlottery/NumericLottery.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/numericlottery/NumericLottery.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/numericlottery/NumericLotteryApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/numericlottery/NumericLotteryApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/CharArraySource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/CharArraySource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/DigitParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/DigitParser.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/DigitParserStdInSourceApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/DigitParserStdInSourceApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/FileAsciiSource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/FileAsciiSource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/FileSource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/FileSource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/FileUTFSource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/FileUTFSource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/ISource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/ISource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/LetterParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/LetterParser.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/LetterParserFileAsciiSourceApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/LetterParserFileAsciiSourceApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/LetterParserFileSourceApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/LetterParserFileSourceApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/ParseFactory$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/ParseFactory$1.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/ParseFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/ParseFactory.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/Parser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/Parser.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/ParserType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/ParserType.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/StringSource.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/StringSource.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/WhitespaceParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/WhitespaceParser.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/parser/WhitespaceParserStdInSourceApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/parser/WhitespaceParserStdInSourceApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/randomgenerator/RandomObjectArrayFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/randomgenerator/RandomObjectArrayFactory.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/randomgenerator/RandomObjectArrayGeneratorApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/randomgenerator/RandomObjectArrayGeneratorApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfo.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfoParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfoParser.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfoParserApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/application/studentinfoparser/StudentInfoParserApp.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/array/ArrayUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/collection/CSDArrayList.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/console/CommandLineUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/console/CommandLineUtil.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/console/Console.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/console/Console.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/converter/BitConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/converter/BitConverter.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/datetime/Date.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/datetime/DateTimeException.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/datetime/DayOfWeek.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/datetime/Time.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/image/AbstractImage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/image/AbstractImage.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/image/IIMage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/image/IIMage.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/image/bitmap/DIBWindows.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/image/bitmap/DIBWindows.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/io/file/FileUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/io/file/FileUtil.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/Complex.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/Fraction.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/OperationStatus.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/OperationStatus.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/OperationStatusException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/OperationStatusException.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/geometry/AnalyticalCircle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Circle.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/geometry/CoordinateType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/geometry/CoordinateType.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/math/geometry/Point.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/math/geometry/Point.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/number/NumberUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/number/NumberUtil.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/string/StringUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/string/StringUtil.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/system/SystemUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/system/SystemUtil.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/tuple/Pair.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/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-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/wrapper/IntValue.class -------------------------------------------------------------------------------- /src/Sample/out/production/Sample/org/csystem/util/wrapper/MutableIntValue.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/Sample/out/production/Sample/org/csystem/util/wrapper/MutableIntValue.class -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/app/App.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | CSDArrayList sınıfı 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package org.csystem.app; 5 | 6 | import org.csystem.application.device.Device; 7 | import org.csystem.util.console.Console; 8 | import org.csystem.util.string.StringUtil; 9 | import org.csystem.util.tuple.Pair; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Random; 13 | 14 | class App { 15 | public static void main(String[] args) 16 | { 17 | ArrayList> devices = new ArrayList<>(); 18 | Random r = new Random(); 19 | int count = Console.readInt("Bir sayı giriniz:"); 20 | 21 | for (int i = 0; i < count; ++i) { 22 | String name = StringUtil.getRandomTextTR(r, 10); 23 | devices.add(Pair.of(name, new Device(i + 1, name, Util.getRandomHost(r)))); 24 | } 25 | 26 | int size = devices.size(); 27 | 28 | for (int i = 0; i < size; ++i) 29 | System.out.println(devices.get(i)); 30 | } 31 | } 32 | 33 | class Util { 34 | public static String getRandomHost(Random r) 35 | { 36 | return r.nextInt(256) + "." + r.nextInt(256) + "." + r.nextInt(256) + "." + r.nextInt(256); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/app/factory/fraction/RandomFractionFactory.java: -------------------------------------------------------------------------------- 1 | package org.csystem.app.factory.fraction; 2 | 3 | import org.csystem.util.math.Fraction; 4 | 5 | import java.util.Random; 6 | 7 | public class RandomFractionFactory { 8 | private final Random m_random; 9 | 10 | public RandomFractionFactory() 11 | { 12 | this(new Random()); 13 | } 14 | 15 | public RandomFractionFactory(Random random) 16 | { 17 | m_random = random; 18 | } 19 | 20 | public Fraction getRandomFraction(int min, int max) 21 | { 22 | return new Fraction(m_random.nextInt(max - min) + min, m_random.nextInt(max - min) + min); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/app/io/file/ReaderApp.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | ReaderApp 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package org.csystem.app.io.file; 5 | 6 | import org.csystem.util.converter.BitConverter; 7 | 8 | import java.io.FileInputStream; 9 | import java.io.FileNotFoundException; 10 | import java.io.IOException; 11 | 12 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 13 | 14 | public class ReaderApp { 15 | public static void main(String[] args) 16 | { 17 | checkIfNotEqualAndExit(args, 1, "Invalid arguments"); 18 | 19 | try (FileInputStream fis = new FileInputStream(args[0])) { 20 | int result; 21 | byte [] data = new byte[256]; 22 | 23 | while ((result = fis.read(data)) > 0 && result == data.length) { 24 | String str = BitConverter.toStringFixed(data); 25 | System.out.println(str); 26 | } 27 | 28 | if (result != -1) 29 | throw new IOException("File format corruption"); 30 | } 31 | catch (FileNotFoundException ignore) { 32 | System.err.println("File not found"); 33 | } 34 | catch (IOException ex) { 35 | System.err.printf("Exception occurs:%s", ex.getMessage()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/app/io/file/WriterApp.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | WriterApp 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package org.csystem.app.io.file; 5 | 6 | import org.csystem.util.converter.BitConverter; 7 | 8 | import java.io.FileOutputStream; 9 | import java.io.IOException; 10 | import java.util.Scanner; 11 | 12 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 13 | 14 | public class WriterApp { 15 | public static void main(String[] args) 16 | { 17 | checkIfNotEqualAndExit(args, 1, "Invalid arguments"); 18 | 19 | Scanner kb = new Scanner(System.in); 20 | 21 | try (FileOutputStream fos = new FileOutputStream(args[0], true)) { 22 | for (;;) { 23 | System.out.print("Input a text:"); 24 | String text = kb.nextLine(); 25 | 26 | if ("quit".equals(text)) 27 | break; 28 | 29 | fos.write(BitConverter.getFixedBytes(text, 128)); 30 | } 31 | } 32 | catch (NumberFormatException ignore) { 33 | System.err.println("Invalid number format"); 34 | } 35 | catch (IOException ignore) { 36 | System.err.println("IO problem occurs. Try again later!..."); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/ballfall/BallFall.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.ballfall; 2 | 3 | public class BallFall { 4 | private static boolean updateRightFlag(boolean isRight, int ballIndex, int width) 5 | { 6 | if (ballIndex == 0) 7 | isRight = true; 8 | else if (ballIndex == width - 1) 9 | isRight = false; 10 | 11 | return isRight; 12 | } 13 | 14 | private static int updateBallIndex(boolean isRight, int ballIndex) 15 | { 16 | if (isRight) 17 | return ballIndex + 1; 18 | 19 | return ballIndex - 1; 20 | } 21 | 22 | private String m_shapeStr; 23 | 24 | private void fillSpace(int begin, int end) //[begin, end) 25 | { 26 | for (int i = begin; i < end; ++i) 27 | m_shapeStr += ' '; 28 | } 29 | 30 | public void fillBall(int ballIndex, int end) 31 | { 32 | fillSpace(0, ballIndex); 33 | m_shapeStr += '*'; 34 | fillSpace(ballIndex + 1, end); 35 | } 36 | 37 | 38 | public BallFall() 39 | { 40 | m_shapeStr = ""; 41 | } 42 | 43 | public void play(int width, int height) 44 | { 45 | int ballIndex = 0; 46 | boolean isRight = false; 47 | m_shapeStr = ""; 48 | 49 | for (int i = 1; i <= height; ++i) { 50 | m_shapeStr += '|'; 51 | fillBall(ballIndex, width); 52 | if (width != 1) { 53 | isRight = updateRightFlag(isRight, ballIndex, width); 54 | ballIndex = updateBallIndex(isRight, ballIndex); 55 | } 56 | m_shapeStr += "|\r\n"; 57 | } 58 | } 59 | 60 | public String getShapeStr() 61 | { 62 | return m_shapeStr; 63 | } 64 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/ballfall/BallFallGameApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.ballfall; 2 | 3 | public class BallFallGameApp { 4 | private BallFallGameApp() 5 | { 6 | } 7 | 8 | public static void run() 9 | { 10 | java.util.Scanner kb = new java.util.Scanner(System.in); 11 | BallFall ballFall = new BallFall(); 12 | 13 | for (;;) { 14 | System.out.print("Width?"); 15 | int width = Integer.parseInt(kb.nextLine()); 16 | 17 | if (width == 0) 18 | break; 19 | 20 | System.out.print("Height?"); 21 | int height= Integer.parseInt(kb.nextLine()); 22 | 23 | ballFall.play(width, height); 24 | 25 | System.out.println(ballFall.getShapeStr()); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/calculatesumcountminmaxaverage/CalculateSumCountMaxMinAverageApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.calculatesumcountminmaxaverage; 2 | 3 | public class CalculateSumCountMaxMinAverageApp { 4 | public static void run() 5 | { 6 | SumCountMaxMinAverageOperation operation = new SumCountMaxMinAverageOperation(); 7 | 8 | operation.run(); 9 | 10 | operation.displayReport(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverage.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.calculatesumcountminmaxaverage; 2 | 3 | public class SumCountMaxMinAverage { 4 | private int m_sum; 5 | private int m_count; 6 | private int m_min; 7 | private int m_max; 8 | 9 | public void sum(int val) 10 | { 11 | m_sum += val; 12 | ++m_count; 13 | if (val < m_min) 14 | m_min = val; 15 | 16 | if (m_max < val) 17 | m_max = val; 18 | } 19 | 20 | public double getAverage() 21 | { 22 | return (double)m_sum / m_count; 23 | } 24 | 25 | public int getSum() 26 | { 27 | return m_sum; 28 | } 29 | 30 | public int getCount() 31 | { 32 | return m_count; 33 | } 34 | 35 | public int getMin() 36 | { 37 | return m_min; 38 | } 39 | 40 | public int getMax() 41 | { 42 | return m_max; 43 | } 44 | 45 | public String toString() 46 | { 47 | return String.format("{sum: %d, count: %d, min: %d, max: %d, avg: %f}", 48 | m_sum, m_count, m_min, m_max, getAverage()); 49 | } 50 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/calculatesumcountminmaxaverage/SumCountMaxMinAverageOperation.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.calculatesumcountminmaxaverage; 2 | 3 | import java.util.Scanner; 4 | 5 | public class SumCountMaxMinAverageOperation { 6 | private final Scanner m_kb; 7 | private final SumCountMaxMinAverage m_sumCountMaxMinAverage; 8 | 9 | private int getValue() 10 | { 11 | for (;;) { 12 | System.out.print("Bir tamsayı giriniz:"); 13 | int val = Integer.parseInt(m_kb.nextLine()); 14 | 15 | if (0 <= val && val <= 100) 16 | return val; 17 | 18 | System.out.print("Geçersiz değer girdiniz!...Yeni bir değer giriniz:"); 19 | } 20 | } 21 | 22 | private int getOption() 23 | { 24 | int option; 25 | 26 | do 27 | option = Integer.parseInt(m_kb.nextLine()); 28 | while (option != 0 && option != 1); 29 | 30 | return option; 31 | } 32 | 33 | public SumCountMaxMinAverageOperation() 34 | { 35 | m_kb = new Scanner(System.in); 36 | m_sumCountMaxMinAverage = new SumCountMaxMinAverage(); 37 | } 38 | 39 | public SumCountMaxMinAverage getSumCountMaxMinAverage() 40 | { 41 | return m_sumCountMaxMinAverage; 42 | } 43 | 44 | public void run() 45 | { 46 | for (;;) { 47 | int val = getValue(); 48 | m_sumCountMaxMinAverage.sum(val); 49 | 50 | System.out.print("Yeni bir değer girmek istiyor musunuz?[Evet için 1(bir) Hayır için 0(sıfır) değerlerinden birini giriniz]"); 51 | int option = getOption(); 52 | if (option == 0) 53 | break; 54 | } 55 | } 56 | 57 | public void displayReport() 58 | { 59 | System.out.printf("Toplam %d değer girildi%n", m_sumCountMaxMinAverage.getCount()); 60 | System.out.printf("Max = %d%n", m_sumCountMaxMinAverage.getMax()); 61 | System.out.printf("Min = %d%n", m_sumCountMaxMinAverage.getMin()); 62 | System.out.printf("Ortalama = %f%n", m_sumCountMaxMinAverage.getAverage()); 63 | } 64 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/CompanyApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.company; 2 | 3 | public class CompanyApp { 4 | private static Manager getManager() 5 | { 6 | Manager m = new Manager(); 7 | 8 | m.setName("Ali"); 9 | m.setCitizenId("12345678912"); 10 | m.setAddress("İstanbul"); 11 | m.setSalary(40000); 12 | m.setDepartment("Yazılım"); 13 | 14 | return m; 15 | } 16 | 17 | private static SalesManager getSalesManager() 18 | { 19 | SalesManager sm = new SalesManager(); 20 | 21 | sm.setName("Veli"); 22 | sm.setCitizenId("12345678916"); 23 | sm.setAddress("İzmir"); 24 | sm.setSalary(30000); 25 | sm.setDepartment("Pazarlama"); 26 | sm.setExtra(10000); 27 | 28 | return sm; 29 | } 30 | 31 | private static Worker getWorker() 32 | { 33 | Worker w = new Worker(); 34 | 35 | w.setName("Selami"); 36 | w.setCitizenId("12345678918"); 37 | w.setAddress("Ankara"); 38 | w.setFeePerHour(100); 39 | w.setHourPerDay(6); 40 | 41 | return w; 42 | } 43 | 44 | private static ProjectWorker getProjectWorker() 45 | { 46 | ProjectWorker pw = new ProjectWorker(); 47 | 48 | pw.setName("Secati"); 49 | pw.setCitizenId("12345678910"); 50 | pw.setAddress("Ankara"); 51 | pw.setFeePerHour(120); 52 | pw.setHourPerDay(5); 53 | pw.setExtra(3000); 54 | pw.setProjectName("Weather Sensor Web Service"); 55 | 56 | return pw; 57 | } 58 | 59 | public static void run() 60 | { 61 | HumanResources humanResources = new HumanResources(); 62 | Manager m = getManager(); 63 | Worker w = getWorker(); 64 | SalesManager sm = getSalesManager(); 65 | ProjectWorker pw = getProjectWorker(); 66 | 67 | //... 68 | 69 | humanResources.payInsurance(m); 70 | humanResources.payInsurance(w); 71 | humanResources.payInsurance(sm); 72 | humanResources.payInsurance(pw); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/Employee.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.company; 2 | 3 | public abstract class Employee { 4 | private String m_name; 5 | private String m_citizenId; 6 | private String m_address; 7 | //... 8 | 9 | protected Employee(/*...*/) 10 | { 11 | //... 12 | } 13 | 14 | public String getName() 15 | { 16 | return m_name; 17 | } 18 | 19 | public void setName(String name) 20 | { 21 | //... 22 | m_name = name; 23 | } 24 | 25 | public String getCitizenId() 26 | { 27 | return m_citizenId; 28 | } 29 | 30 | public void setCitizenId(String citizenId) 31 | { 32 | //... 33 | m_citizenId = citizenId; 34 | } 35 | 36 | public String getAddress() 37 | { 38 | return m_address; 39 | } 40 | 41 | public void setAddress(String address) 42 | { 43 | //... 44 | m_address = address; 45 | } 46 | 47 | public abstract double calculateInsurancePayment(); 48 | 49 | //... 50 | } 51 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/HumanResources.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.company; 2 | 3 | public class HumanResources { 4 | //... 5 | public void payInsurance(Employee employee) 6 | { 7 | System.out.printf("Name:%s%n", employee.getName()); 8 | System.out.printf("Citizen Id:%s%n", employee.getCitizenId()); 9 | System.out.printf("Insurance payment:%f%n", employee.calculateInsurancePayment()); 10 | } 11 | //... 12 | } 13 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/Manager.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.company; 2 | 3 | public class Manager extends Employee { 4 | private String m_department; 5 | private double m_salary; 6 | //... 7 | 8 | public String getDepartment() 9 | { 10 | return m_department; 11 | } 12 | 13 | public void setDepartment(String department) 14 | { 15 | //... 16 | m_department = department; 17 | } 18 | 19 | public double getSalary() 20 | { 21 | return m_salary; 22 | } 23 | 24 | public void setSalary(double salary) 25 | { 26 | //... 27 | m_salary = salary; 28 | } 29 | 30 | public double calculateInsurancePayment() 31 | { 32 | return m_salary * 1.5; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/ProjectWorker.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.company; 2 | 3 | public class ProjectWorker extends Worker { 4 | private String m_projectName; 5 | private double m_extra; 6 | 7 | //... 8 | 9 | public String getProjectName() 10 | { 11 | return m_projectName; 12 | } 13 | 14 | public void setProjectName(String projectName) 15 | { 16 | //... 17 | m_projectName = projectName; 18 | } 19 | 20 | public double getExtra() 21 | { 22 | return m_extra; 23 | } 24 | 25 | public void setExtra(double extra) 26 | { 27 | //... 28 | m_extra = extra; 29 | } 30 | 31 | public double calculateInsurancePayment() 32 | { 33 | return super.calculateInsurancePayment() + m_extra; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/SalesManager.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.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; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/company/Worker.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.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/application/date/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 tariharasındaki (verilen tarih dahil) gün sayısının 7(yedi) ile bölümünden 7 | elde edilen kalan ile bulunabilir. Değer 0(sıfır) ise "Pazar", 1(bir) ise "Pazartesi", ... 6(altı) ise "Cumartesi" 8 | günlerine karşılık gelir 9 | - 1.1.1900 öncesindeki tarihler geçersizler kabul edilir 10 | - Parametresi ile aldığı gün, ay ve yıl bilgilerine ilişkin tarihin hafta sonu olup olmadığını test eden isWeekend 11 | ve hafta içi olup olmadığını test eden isWeekday metotlarını yazınız. Metotlar tarih geçerliliği kontrolü yapmayacaktır 12 | (İleride daha iyisi yazılacaktır) 13 | ----------------------------------------------------------------------------------------------------------------------*/ 14 | package org.csystem.application.date; 15 | 16 | import org.csystem.util.datetime.Date; 17 | import org.csystem.util.datetime.Month; 18 | 19 | public class DateApp { 20 | private DateApp() 21 | { 22 | } 23 | 24 | private static void displayDateTR(Date d) 25 | { 26 | System.out.println(d.toLongDateStringTR()); 27 | System.out.println(d.isWeekend() ? "Bugün kurs var tekrar yaptınız mı?" : "Kurs günü yaklaşıyor. Tekrar yapmayı unutmayınız"); 28 | } 29 | 30 | private static void displayDateEN(Date d) 31 | { 32 | System.out.println(d.toLongDateStringEN()); 33 | System.out.println(d.isWeekend() ? "That is the course day. Did you review?" : 34 | "Course day is coming. Do not forget to review"); 35 | } 36 | public static void run() 37 | { 38 | java.util.Scanner kb = new java.util.Scanner(System.in); 39 | 40 | for (;;) { 41 | System.out.print("Gün?"); 42 | int day = Integer.parseInt(kb.nextLine()); 43 | 44 | if (day == 0) 45 | break; 46 | 47 | System.out.print("Ay?"); 48 | int month = Integer.parseInt(kb.nextLine()); 49 | 50 | System.out.print("Yıl?"); 51 | int year = Integer.parseInt(kb.nextLine()); 52 | 53 | Date date = new Date(day, month, year); //Geçersiz tarih durumu ileride ele alınacaktır 54 | 55 | displayDateTR(date); 56 | displayDateEN(date); 57 | } 58 | 59 | System.out.println("Tekrar yapıyor musunuz?"); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/device/Device.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.device; 2 | 3 | public class Device { 4 | private long m_id; 5 | private String m_name; 6 | private String m_host; 7 | 8 | public Device(String name, String host) 9 | { 10 | this(0, name, host); 11 | } 12 | 13 | public Device(long id, String name, String host) 14 | { 15 | m_id = id; 16 | m_name = name; 17 | m_host = host; 18 | } 19 | 20 | public long getId() 21 | { 22 | return m_id; 23 | } 24 | 25 | public void setId(long id) 26 | { 27 | m_id = id; 28 | } 29 | 30 | public String getName() 31 | { 32 | return m_name; 33 | } 34 | 35 | public void setName(String name) 36 | { 37 | m_name = name; 38 | } 39 | 40 | public String getHost() 41 | { 42 | return m_host; 43 | } 44 | 45 | public void setHost(String host) 46 | { 47 | m_host = host; 48 | } 49 | 50 | public String toString() 51 | { 52 | return String.format("[%s]%s-%s", m_id, m_name, m_host); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/device/DeviceMenuApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.device; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.IOException; 6 | 7 | public class DeviceMenuApp { 8 | public static void run(String [] args) 9 | { 10 | CommandLineUtil.checkIfNotEqualAndExit(args, 1, "Wrong number od arguments"); 11 | 12 | try (DeviceMenuRunner runner = new DeviceMenuRunner(args[0])) { 13 | runner.run(); 14 | } 15 | catch (IOException ignore) { 16 | System.err.println("I/O error occurs"); 17 | } 18 | catch (Throwable ignore) { 19 | System.err.println("Internal problem. Try again later!..."); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/device/DeviceMenuRunner.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.device; 2 | 3 | import org.csystem.util.console.Console; 4 | 5 | import java.io.Closeable; 6 | import java.io.EOFException; 7 | import java.io.IOException; 8 | import java.io.RandomAccessFile; 9 | 10 | public class DeviceMenuRunner implements Closeable { 11 | private final RandomAccessFile m_deviceFile; 12 | private final String m_path; 13 | private long m_curId; 14 | 15 | private static void displayMenu() 16 | { 17 | System.out.println("1.Insert"); 18 | System.out.println("2.List"); 19 | System.out.println("3.Delete"); 20 | System.out.println("4.Exit"); 21 | System.out.print("Option:"); 22 | } 23 | 24 | private Device getDeviceByStdIn() 25 | { 26 | String name = Console.read("Input name:"); 27 | String host = Console.read("Input host:"); 28 | 29 | return new Device(m_curId, name, host); 30 | } 31 | 32 | private void listDevices() throws IOException 33 | { 34 | m_deviceFile.seek(Long.BYTES); 35 | 36 | try { 37 | for (;;) { 38 | Device device = DevicePersistence.readActiveDevice(m_deviceFile); 39 | 40 | if (device == null) 41 | continue; 42 | 43 | System.out.println(device); 44 | } 45 | } 46 | catch (EOFException ignore) { 47 | 48 | } 49 | } 50 | 51 | private void insertProc() throws IOException 52 | { 53 | Device device = getDeviceByStdIn(); 54 | 55 | m_deviceFile.seek(m_deviceFile.length()); 56 | DevicePersistence.writeDevice(device, m_deviceFile); 57 | m_deviceFile.seek(0); 58 | m_deviceFile.writeLong(++m_curId); 59 | } 60 | 61 | private void listProc() throws IOException 62 | { 63 | if (m_deviceFile.length() != Long.BYTES) 64 | this.listDevices(); 65 | else 66 | System.out.println("No device yet!..."); 67 | } 68 | 69 | private void deleteProc() throws IOException 70 | { 71 | String name = Console.read("Input name:"); 72 | m_deviceFile.seek(Long.BYTES); 73 | boolean found = false; 74 | 75 | try { 76 | for (;;) { 77 | long curOffset = m_deviceFile.getFilePointer(); 78 | Device device = DevicePersistence.readActiveDevice(m_deviceFile); 79 | 80 | if (device == null) 81 | continue; 82 | 83 | if (device.getName().equalsIgnoreCase(name)) { 84 | found = true; 85 | m_deviceFile.seek(curOffset); 86 | m_deviceFile.writeBoolean(false); 87 | break; 88 | } 89 | } 90 | } 91 | catch (EOFException ignore) { 92 | if (!found) 93 | System.out.println("No device found!..."); 94 | } 95 | } 96 | 97 | private void quitProc() 98 | { 99 | System.out.println("Thanks"); 100 | System.exit(0); 101 | } 102 | 103 | private void doWorkForMenuOption(int option) throws IOException 104 | { 105 | switch (option) { 106 | case 1: 107 | this.insertProc(); 108 | break; 109 | case 2: 110 | this.listProc(); 111 | break; 112 | case 3: 113 | this.deleteProc(); 114 | break; 115 | case 4: 116 | this.quitProc(); 117 | break; 118 | default: 119 | System.out.println("Invalid menu option"); 120 | } 121 | } 122 | 123 | private void doMenuOperations() throws IOException 124 | { 125 | displayMenu(); 126 | int option = Console.readInt("", "Invalid menu option number"); 127 | this.doWorkForMenuOption(option); 128 | } 129 | 130 | public DeviceMenuRunner(String path) throws IOException 131 | { 132 | m_path = path; 133 | m_deviceFile = new RandomAccessFile(m_path, "rw"); 134 | } 135 | 136 | public void run() throws IOException 137 | { 138 | if (m_deviceFile.length() == 0) 139 | m_deviceFile.writeLong(++m_curId); 140 | else 141 | m_curId = m_deviceFile.readLong(); 142 | 143 | for (;;) 144 | this.doMenuOperations(); 145 | } 146 | 147 | public void close() throws IOException 148 | { 149 | m_deviceFile.close(); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/device/DevicePersistence.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.device; 2 | 3 | import org.csystem.application.devices.DeviceInfo; 4 | 5 | import java.io.IOException; 6 | import java.io.RandomAccessFile; 7 | 8 | public final class DevicePersistence { 9 | private DevicePersistence() 10 | { 11 | } 12 | 13 | public static void writeDevice(Device dev, RandomAccessFile raf) throws IOException 14 | { 15 | raf.writeBoolean(true); 16 | raf.writeLong(dev.getId()); 17 | raf.writeUTF(dev.getName()); 18 | raf.writeUTF(dev.getHost()); 19 | } 20 | 21 | public static Device readActiveDevice(RandomAccessFile raf) throws IOException 22 | { 23 | DeviceRecord dr = readDevice(raf); 24 | 25 | return dr.active ? dr.device : null; 26 | } 27 | 28 | public static DeviceRecord readDevice(RandomAccessFile raf) throws IOException 29 | { 30 | boolean active = raf.readBoolean(); 31 | long id = raf.readLong(); 32 | String name = raf.readUTF(); 33 | String host = raf.readUTF(); 34 | 35 | return new DeviceRecord(new Device(id, name, host), active); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/device/DeviceRecord.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.device; 2 | 3 | public class DeviceRecord { 4 | public Device device; 5 | public boolean active; 6 | 7 | public DeviceRecord(Device device, boolean active) 8 | { 9 | this.device = device; 10 | this.active = active; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/devices/DeviceFactory.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.devices; 2 | 3 | public class DeviceFactory { 4 | private final String [] m_devicesStr; 5 | 6 | public DeviceFactory() 7 | { 8 | m_devicesStr = new String[] { 9 | "Weather Sensor\0:34000:\0:185.45.67.23", 10 | "Humidity Sensor\0:35000:\0:185.45.67.27", 11 | "Test sensor\0:4000:\0:195.45.67.23", 12 | }; 13 | } 14 | 15 | public DeviceInfo [] getDevices() 16 | { 17 | DeviceInfo [] devices = new DeviceInfo[m_devicesStr.length]; 18 | 19 | for (int i = 0; i < m_devicesStr.length; ++i) { 20 | String devicesStr = m_devicesStr[i]; 21 | 22 | int firstNullCharIndex = devicesStr.indexOf('\0'); 23 | 24 | //... 25 | 26 | int lastNullCharIndex = devicesStr.lastIndexOf('\0'); 27 | 28 | //... 29 | 30 | int port = Integer.parseInt(devicesStr, firstNullCharIndex + 2, lastNullCharIndex - 1, 10); // Since Java 9 31 | 32 | String name = devicesStr.substring(0, firstNullCharIndex); 33 | String host = devicesStr.substring(lastNullCharIndex + 2); 34 | 35 | devices[i] = new DeviceInfo(name, host, port); 36 | } 37 | 38 | return devices; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/devices/DeviceInfo.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.devices; 2 | 3 | public class DeviceInfo { 4 | private String m_name; 5 | private String m_host; 6 | private int m_port; 7 | private boolean m_open; 8 | 9 | public DeviceInfo(String name, String host, int port) 10 | { 11 | this(name, host, port, true); 12 | } 13 | 14 | public DeviceInfo(String name, String host, int port, boolean open) 15 | { 16 | //... 17 | m_name = name; 18 | m_host = host; 19 | m_port = port; 20 | m_open = open; 21 | } 22 | 23 | public String getName() 24 | { 25 | return m_name; 26 | } 27 | 28 | public void setName(String name) 29 | { 30 | //... 31 | m_name = name; 32 | } 33 | 34 | public String getHost() 35 | { 36 | return m_host; 37 | } 38 | 39 | public void setHost(String host) 40 | { 41 | //... 42 | m_host = host; 43 | } 44 | 45 | public int getPort() 46 | { 47 | return m_port; 48 | } 49 | 50 | public void setPort(int port) 51 | { 52 | //... 53 | m_port = port; 54 | } 55 | 56 | public boolean isOpen() 57 | { 58 | return m_open; 59 | } 60 | 61 | public void setOpen(boolean open) 62 | { 63 | //... 64 | m_open = open; 65 | } 66 | 67 | public String toString() 68 | { 69 | return String.format("[%s]%s:%d %s", m_name, m_host, m_port, m_open ? "OPEN" : "CLOSED"); 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/devices/DevicesApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.devices; 2 | 3 | public class DevicesApp { 4 | private DevicesApp() 5 | {} 6 | 7 | public static void run() 8 | { 9 | DeviceFactory factory = new DeviceFactory(); 10 | 11 | for (DeviceInfo di : factory.getDevices()) 12 | System.out.println(di.toString()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/devices/StoreDevicesToArrayApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.devices; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Random; 5 | import java.util.Scanner; 6 | 7 | public final class StoreDevicesToArrayApp { 8 | private StoreDevicesToArrayApp() 9 | {} 10 | 11 | public static void run() 12 | { 13 | Random random = new Random(); 14 | Scanner kb = new Scanner(System.in); 15 | System.out.print("Başlangıç \"capacity\" değerini giriniz:"); 16 | ArrayList devices = new ArrayList<>(Integer.parseInt(kb.nextLine())); 17 | 18 | for (;;) { 19 | System.out.print("Cihaz adını giriniz:"); 20 | String name = kb.nextLine(); 21 | 22 | if ("elma".equals(name)) 23 | break; 24 | 25 | System.out.print("Cihaz IP adresini giriniz:"); 26 | String host = kb.nextLine(); 27 | 28 | System.out.print("Cihaz port numarasını giriniz:"); 29 | int port = Integer.parseInt(kb.nextLine()); 30 | 31 | devices.add(new DeviceInfo(name, host, port, random.nextBoolean())); 32 | System.out.printf("Size:%d%n", devices.size()); 33 | } 34 | 35 | System.out.println("-------------------------------------------"); 36 | 37 | for (DeviceInfo di : devices) 38 | System.out.println(di); 39 | 40 | 41 | System.out.printf("Size:%d%n", devices.size()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/exam/ExamSimulation.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.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 String m_lectureName; 10 | private int[][] m_grades; 11 | private double [] m_averages; 12 | private double m_average; 13 | 14 | private void findAverages() 15 | { 16 | int totalNumberOfStudents = 0; 17 | int totalGrades = 0; 18 | 19 | for (int i = 0; i < m_grades.length; ++i) { 20 | int total = ArrayUtil.sum(m_grades[i]); 21 | 22 | m_averages[i] = (double)total / m_grades[i].length; 23 | totalGrades += total; 24 | totalNumberOfStudents += m_grades[i].length; 25 | } 26 | 27 | m_average = (double)totalGrades / totalNumberOfStudents; 28 | } 29 | 30 | private void fillGrades() 31 | { 32 | Random r = new Random(); 33 | Scanner kb = new Scanner(System.in); 34 | 35 | System.out.printf("%s sınavına girecek şube sayısını giriniz:", m_lectureName); 36 | m_grades = new int[Integer.parseInt(kb.nextLine())][]; 37 | m_averages = new double[m_grades.length]; 38 | 39 | for (int i = 0; i < m_grades.length; ++i) { 40 | System.out.printf("%d. şubenin öğrenci sayısı:", i + 1); 41 | int count = Integer.parseInt(kb.nextLine()); 42 | 43 | m_grades[i] = ArrayUtil.getRandomArray(r, count, 0, 100); 44 | } 45 | } 46 | 47 | public ExamSimulation(String name) 48 | { 49 | m_lectureName = name; 50 | } 51 | 52 | public void run() 53 | { 54 | fillGrades(); 55 | findAverages(); 56 | } 57 | 58 | public void displayGrades() 59 | { 60 | System.out.printf("%s dersi sınav notları:%n", m_lectureName); 61 | System.out.println("-------------------------------------------------------"); 62 | for (int i = 0; i < m_grades.length; ++i) { 63 | System.out.printf("%d. şube notları:", i + 1); 64 | ArrayUtil.display(3, m_grades[i]); 65 | } 66 | System.out.println("-------------------------------------------------------"); 67 | } 68 | 69 | public void displayAverages() 70 | { 71 | System.out.printf("%s dersi için not ortalamaları:%n", m_lectureName); 72 | System.out.println("-------------------------------------------------------"); 73 | for (int i = 0; i < m_averages.length; ++i) 74 | System.out.printf("%d.şube not ortalaması:%f%n", i + 1, m_averages[i]); 75 | 76 | System.out.printf("Okul ortalaması:%f%n", m_average); 77 | System.out.println("-------------------------------------------------------"); 78 | } 79 | 80 | public void displayReport() 81 | { 82 | System.out.println("//////////////////////////////////////////////////////////"); 83 | displayGrades(); 84 | displayAverages(); 85 | System.out.println("//////////////////////////////////////////////////////////"); 86 | } 87 | 88 | public String getLectureName() 89 | { 90 | return m_lectureName; 91 | } 92 | 93 | public void setLectureName(String lectureName) 94 | { 95 | m_lectureName = lectureName; 96 | } 97 | 98 | public double getAverage() 99 | { 100 | return m_average; 101 | } 102 | 103 | public int getNumberOfClasses() 104 | { 105 | return m_grades.length; 106 | } 107 | 108 | public double getAverage(int id) 109 | { 110 | return m_averages[id - 1]; 111 | } 112 | 113 | public int getNumberOfStudents(int idc) 114 | { 115 | return m_grades[idc].length; 116 | } 117 | 118 | public double getGrade(int idc, int ids) 119 | { 120 | return m_grades[idc - 1][ids - 1]; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/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 Matematik sınavı 4 | için herbir şubenin ayrı ayrı not ortalamaları ile okulun ortalamasını bulan basit bir simülasyon programını 5 | yazınız. Programı mümkün olduğunca genel düşünerek yazmaya çalışınız 6 | ----------------------------------------------------------------------------------------------------------------------*/ 7 | package org.csystem.application.exam; 8 | 9 | public class ExamSimulationApp { 10 | private ExamSimulationApp() 11 | { 12 | } 13 | public static void run() 14 | { 15 | ExamSimulation examSimulationMath = new ExamSimulation("Matematik"); 16 | ExamSimulation examSimulationPhysics = new ExamSimulation("Fizik"); 17 | 18 | examSimulationMath.run(); 19 | examSimulationPhysics.run(); 20 | examSimulationMath.displayReport(); 21 | examSimulationPhysics.displayReport(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/findtextincurly/FindTextInCurly.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.findtextincurly; 2 | 3 | public class FindTextInCurly { 4 | private String m_text; 5 | private String m_result; 6 | private boolean valid; 7 | 8 | public FindTextInCurly(String txt) 9 | { 10 | m_text = txt; 11 | m_result = m_text; 12 | valid = true; 13 | } 14 | 15 | public void findText() 16 | { 17 | for (;;) { 18 | int begin = m_result.indexOf("{"); 19 | int end = m_result.lastIndexOf("}"); 20 | 21 | if (begin == -1 && end != -1 || begin > end) { 22 | valid = false; 23 | break; 24 | } 25 | 26 | if (end == -1) 27 | break; 28 | 29 | m_result = m_result.substring(begin + 1, end); 30 | } 31 | } 32 | 33 | public String getText() 34 | { 35 | return m_text; 36 | } 37 | 38 | public void setText(String text) 39 | { 40 | m_text = text; 41 | } 42 | 43 | public String getResult() 44 | { 45 | return m_result; 46 | } 47 | 48 | public boolean isValid() 49 | { 50 | return valid; 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/findtextincurly/FindTextIntCurlyApp.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | Homework-008-1. sorunun bir çözümü 3 | Dikkat: IntelliJ IDEA IDE uygulamasının console'u ile test ederken yazıyı değiştirmek genellikle hatalı yazı yazılmasına 4 | yol açar. Bunun için aşağıdali örnek yazıları da kopyalayıp yapıtırabilirsiniz 5 | 6 | - Bu örnek {aslında {hiç zor}} değil 7 | - Bu örnekten {daha {zor {örnekler de yapacağız} değil}} mi? 8 | - Yanlış {bir giriş için hata mesajı yazdırılacak 9 | - Bu örnekten {daha 10 | - Bu örnekten daha zor } örnekler 11 | - {test} 12 | - {{test}} 13 | - {} 14 | (ileride daha iyisi yazılacaktır) 15 | ----------------------------------------------------------------------------------------------------------------------*/ 16 | package org.csystem.application.findtextincurly; 17 | 18 | import java.util.Scanner; 19 | 20 | class FindTextIntCurlyApp { 21 | private FindTextIntCurlyApp() 22 | { 23 | } 24 | 25 | public static void run() 26 | { 27 | Scanner kb = new Scanner(System.in); 28 | 29 | for (;;) { 30 | System.out.print("Bir yazı giriniz:"); 31 | String str = kb.nextLine(); 32 | 33 | if ("elma".equals(str)) 34 | break; 35 | 36 | FindTextInCurly findTextInCurly = new FindTextInCurly(str); 37 | 38 | findTextInCurly.findText(); 39 | 40 | System.out.println(findTextInCurly.isValid() ? findTextInCurly.getResult() : "yanlış bir giriş"); 41 | } 42 | 43 | System.out.println("Tekrar yapıyor musunuz?"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/FileDeleteApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file; 2 | 3 | import java.io.File; 4 | 5 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 6 | 7 | public final class FileDeleteApp { 8 | private static void listFiles(File dir) 9 | { 10 | for (File file : dir.listFiles()) 11 | System.out.println(file.delete() ? "Success" : "Fail"); 12 | } 13 | 14 | private FileDeleteApp() 15 | {} 16 | 17 | public static void run(String [] args) 18 | { 19 | checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 20 | 21 | File dir = new File(args[0]); 22 | 23 | if (dir.exists()) { 24 | if (dir.isDirectory()) 25 | listFiles(dir); 26 | else 27 | System.out.printf("'%s' not directory%n", dir.getAbsolutePath()); 28 | } 29 | else 30 | System.out.printf("'%s' not exists%n", dir.getAbsolutePath()); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/FileListApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file; 2 | 3 | import java.io.File; 4 | 5 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 6 | 7 | public final class FileListApp { 8 | private static void listFiles(File dir) 9 | { 10 | for (File file : dir.listFiles()) 11 | System.out.println(file.delete() ? "Success" : "Fail"); 12 | } 13 | 14 | private FileListApp() 15 | {} 16 | 17 | public static void run(String [] args) 18 | { 19 | checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 20 | 21 | File dir = new File(args[0]); 22 | 23 | if (dir.exists()) { 24 | if (dir.isDirectory()) 25 | listFiles(dir); 26 | else 27 | System.out.printf("'%s' not directory%n", dir.getAbsolutePath()); 28 | } 29 | else 30 | System.out.printf("'%s' not exists%n", dir.getAbsolutePath()); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/ListDirectoryContentsApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file; 2 | 3 | import java.io.File; 4 | 5 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 6 | import static org.csystem.util.console.CommandLineUtil.getArguments; 7 | 8 | public final class ListDirectoryContentsApp { 9 | private static void listFiles(File dir) 10 | { 11 | String postfix = ""; 12 | 13 | for (File file : dir.listFiles()) { 14 | if (file.isDirectory()) 15 | postfix = " "; 16 | else if (file.isFile()) 17 | postfix = String.format(" %d bytes", file.length()); 18 | 19 | System.out.printf("%s%s%n", file.getName(), postfix); 20 | } 21 | } 22 | 23 | private ListDirectoryContentsApp() 24 | {} 25 | 26 | public static void run(String [] args) 27 | { 28 | args = getArguments(args, "Input directory path:"); 29 | checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 30 | 31 | File dir = new File(args[0]); 32 | 33 | if (dir.exists()) { 34 | if (dir.isDirectory()) 35 | listFiles(dir); 36 | else 37 | System.out.printf("'%s' not directory%n", dir.getAbsolutePath()); 38 | } 39 | else 40 | System.out.printf("'%s' not exists%n", dir.getAbsolutePath()); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/BackupAndCopy.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.copy; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.*; 5 | 6 | public class BackupAndCopy { 7 | private final Path m_sourcePath; 8 | private final Path m_destinationPath; 9 | 10 | private String copy(String message) throws IOException 11 | { 12 | Files.copy(m_sourcePath, m_destinationPath); 13 | 14 | return message; 15 | } 16 | 17 | private String copy() throws IOException 18 | { 19 | try { 20 | return this.copy("Copied successfully"); 21 | } 22 | catch (FileAlreadyExistsException ignore) { 23 | return this.backupAndCopy(); 24 | } 25 | } 26 | 27 | private String backupAndCopy() throws IOException 28 | { 29 | Files.move(m_destinationPath, Path.of(m_destinationPath+ "-bak"), StandardCopyOption.REPLACE_EXISTING); 30 | return this.copy("Copied and backed up successfully..."); 31 | } 32 | 33 | public BackupAndCopy(String sourcePath, String destinationPath) 34 | { 35 | this(Path.of(sourcePath), Path.of(destinationPath)); 36 | } 37 | 38 | public BackupAndCopy(Path sourcePath, Path destinationPath) 39 | { 40 | m_sourcePath = sourcePath; 41 | m_destinationPath = destinationPath; 42 | } 43 | 44 | public String run() throws IOException 45 | { 46 | return this.copy(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/BackupAndCopyApp.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | Sınıf Çalışması: Komut satırından aşağıdaki gibi çalışan programı yazınız: 3 | java org.csystem.app.App 4 | Program komut satırı argümanı verilmezse klavyeden yol ifadesini isteyecektir. src ile aldığı dosyayı dest ile 5 | aldığı dosya olarak kopyalayacaktır. Hedef dosya varsa hedef dosya ismi ve uzantısının sonuna "-bak" eklenerek 6 | yedeklenecektir. Daha önce yedeklenmişse üzerine yazılacaktır. Bu işlemden sonra kopyalama yapılacaktır 7 | ----------------------------------------------------------------------------------------------------------------------*/ 8 | package org.csystem.application.io.file.copy; 9 | 10 | import org.csystem.util.console.CommandLineUtil; 11 | 12 | import java.io.IOException; 13 | import java.nio.file.NoSuchFileException; 14 | 15 | public class BackupAndCopyApp { 16 | private static String [] checkCommandLineArgs(String [] args) 17 | { 18 | if (args.length != 2 && args.length != 0) { 19 | System.err.println("Usage:java CopyAndBackupApp.jar "); 20 | System.exit(1); 21 | } 22 | 23 | return CommandLineUtil.getArguments(args, "Input source and destination file paths:"); 24 | } 25 | 26 | public static void run(String [] args) 27 | { 28 | args = checkCommandLineArgs(args); 29 | 30 | try { 31 | BackupAndCopy backupAndCopy = new BackupAndCopy(args[0], args[1]); 32 | 33 | System.out.println(backupAndCopy.run()); 34 | } 35 | catch (NoSuchFileException ignore) { 36 | System.err.println("File not found"); 37 | } 38 | catch (IOException ignore) { 39 | System.err.println("Invalid arguments"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/ConcatFiles.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.copy; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.File; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.nio.file.Files; 9 | import java.nio.file.Path; 10 | 11 | public class ConcatFiles { 12 | private File m_destinationFile; 13 | private Path[] m_sourcePaths; 14 | private boolean m_success = true; 15 | 16 | private void parseCommandLineArgs(String [] args) 17 | { 18 | CommandLineUtil.checkIfLessAndExit(args, 2, "Command line arguments: file1 file2 ... fileN dest"); 19 | 20 | m_sourcePaths = new Path[args.length - 1]; 21 | 22 | for (int i = 0; i < args.length - 1; ++i) { 23 | Path path = Path.of(args[i]); 24 | if (!Files.exists(path)) { 25 | System.err.printf("%s file not found%n", path); 26 | m_success = false; 27 | continue; 28 | } 29 | m_sourcePaths[i] = path; 30 | } 31 | m_destinationFile = new File(args[args.length - 1]); 32 | } 33 | 34 | private void concat() throws IOException 35 | { 36 | boolean flag = false; 37 | 38 | try (FileOutputStream fos = new FileOutputStream(m_destinationFile)) { 39 | for (Path path : m_sourcePaths) { 40 | Files.copy(path, fos); 41 | } 42 | } 43 | } 44 | 45 | public ConcatFiles(String [] args) 46 | { 47 | this.parseCommandLineArgs(args); 48 | } 49 | 50 | public void run() throws IOException 51 | { 52 | if (m_success) 53 | this.concat(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/ConcatFilesApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.copy; 2 | 3 | import java.io.IOException; 4 | 5 | public class ConcatFilesApp { 6 | public static void run(String [] args) 7 | { 8 | try { 9 | ConcatFiles cf = new ConcatFiles(args); 10 | 11 | cf.run(); 12 | } 13 | catch (IOException ex) { 14 | System.err.println(ex.getMessage()); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/CopyFile.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.copy; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.Files; 5 | import java.nio.file.Path; 6 | import java.nio.file.StandardCopyOption; 7 | 8 | public class CopyFile { 9 | private final Path m_sourcePath; 10 | private final Path m_destinationPath; 11 | 12 | private String copy() throws IOException 13 | { 14 | Files.copy(m_sourcePath, m_destinationPath, StandardCopyOption.REPLACE_EXISTING); 15 | 16 | return "Copied successfully"; 17 | 18 | } 19 | 20 | public CopyFile(String sourcePath, String destinationPath) 21 | { 22 | m_sourcePath = Path.of(sourcePath); 23 | m_destinationPath = Path.of(destinationPath); 24 | } 25 | 26 | public String run() throws IOException 27 | { 28 | return this.copy(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/copy/CopyFileApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.copy; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | import java.nio.file.NoSuchFileException; 8 | 9 | public class CopyFileApp { 10 | private static String [] checkCommandLineArgs(String [] args) 11 | { 12 | if (args.length != 2 && args.length != 0) { 13 | System.err.println("Usage: java org.csystem.application.io.file.copyfile.App "); 14 | System.exit(1); 15 | } 16 | 17 | return CommandLineUtil.getArguments(args, "Input source and destination file paths:"); 18 | } 19 | 20 | public static void run(String [] args) 21 | { 22 | args = checkCommandLineArgs(args); 23 | 24 | try { 25 | CopyFile copyFile = new CopyFile(args[0], args[1]); 26 | 27 | System.out.println(copyFile.run()); 28 | } 29 | catch (FileNotFoundException ignore) { 30 | System.err.println("File not found"); 31 | } 32 | catch (IOException ignore) { 33 | System.err.println("Invalid arguments"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/filecompare/FileCompareApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.filecompare; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | import org.csystem.util.io.file.FileUtil; 5 | 6 | import java.io.IOException; 7 | 8 | public class FileCompareApp { 9 | public static void run(String [] args) 10 | { 11 | CommandLineUtil.checkIfNotEqualAndExit(args, 2, "Wrong number of arguments"); 12 | try { 13 | System.out.println(FileUtil.areSame(args[0], args[1]) ? "Equal" : "Not equal"); 14 | } 15 | catch (IOException ignore) { 16 | System.err.println("IO Error"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/image/bitmap/DIBWindowsApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.image.bitmap; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | import org.csystem.util.image.bitmap.DIBWindows; 5 | 6 | import java.io.IOException; 7 | 8 | public final class DIBWindowsApp { 9 | public static void run(String [] args) 10 | { 11 | CommandLineUtil.checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 12 | 13 | try (DIBWindows dw = new DIBWindows(args[0])) { 14 | System.out.printf("%d x %d%n", dw.getWidth(), dw.getHeight()); 15 | } 16 | catch (IOException ex) { 17 | ex.printStackTrace(); 18 | System.err.println("IO Error occurs"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFile.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.ncharacters; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.Closeable; 5 | import java.io.IOException; 6 | import java.nio.charset.StandardCharsets; 7 | import java.nio.file.Files; 8 | import java.nio.file.Path; 9 | 10 | public class NumberOfCharacterInFile implements Closeable { 11 | private final BufferedReader m_br; 12 | private final char m_ch; 13 | private long m_count; 14 | 15 | public NumberOfCharacterInFile(String path, char ch) throws IOException 16 | { 17 | m_br = Files.newBufferedReader(Path.of(path), StandardCharsets.UTF_8); 18 | m_ch = ch; 19 | } 20 | 21 | public long getCount() 22 | { 23 | return m_count; 24 | } 25 | 26 | public void run() throws IOException 27 | { 28 | int ch; 29 | 30 | while ((ch = m_br.read()) != -1) 31 | if (ch == m_ch) 32 | ++m_count; 33 | } 34 | 35 | public void close() throws IOException 36 | { 37 | if (m_br != null) 38 | m_br.close(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/ncharacters/NumberOfCharacterInFileApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.ncharacters; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.IOException; 6 | 7 | public final class NumberOfCharacterInFileApp { 8 | private static int getEscapeChar(String arg) 9 | { 10 | String escapes = "n\nr\rt\ts "; 11 | int idx = escapes.indexOf(arg.charAt(1)); 12 | 13 | return idx == -1 ? -1 : escapes.charAt(idx + 1); 14 | } 15 | 16 | private static char checkAndGetChar(String arg) 17 | { 18 | int len = arg.length(); 19 | 20 | char ch = 0; 21 | boolean invalid = false; 22 | 23 | if (len > 2) 24 | invalid = true; 25 | else if (len == 2) { 26 | if (arg.charAt(0) == '\\') { 27 | int result = getEscapeChar(arg); 28 | 29 | if (result == -1) 30 | invalid = true; 31 | else 32 | ch = (char)result; 33 | } 34 | else 35 | invalid = true; 36 | } 37 | else 38 | ch = arg.charAt(0); 39 | 40 | if (invalid) { 41 | System.out.println("Invalid argument"); 42 | System.exit(1); 43 | } 44 | 45 | return ch; 46 | } 47 | 48 | private NumberOfCharacterInFileApp() 49 | { 50 | } 51 | 52 | public static void run(String [] args) 53 | { 54 | CommandLineUtil.checkIfNotEqualAndExit(args, 2, "Wrong number of arguments"); 55 | 56 | char ch = checkAndGetChar(args[1]); 57 | 58 | try (NumberOfCharacterInFile nocf = new NumberOfCharacterInFile(args[0], ch)) { 59 | nocf.run(); 60 | System.out.println(nocf.getCount()); 61 | } 62 | catch (IOException ignore) { 63 | System.err.println("IOError occurs"); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdIn.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.randomaccess; 2 | 3 | import java.io.Closeable; 4 | import java.io.EOFException; 5 | import java.io.IOException; 6 | import java.io.RandomAccessFile; 7 | import java.util.Scanner; 8 | 9 | public final class RandomAccessFileWriteFromStdIn implements Closeable { 10 | private final RandomAccessFile m_raf; 11 | private final Scanner m_stdIn; 12 | private final String m_quitText; 13 | private final String m_prompt; 14 | 15 | private void runForWrite() throws IOException 16 | { 17 | m_raf.seek(m_raf.length()); //Dosya göstericisini sona çektik 18 | 19 | for (;;) { 20 | System.out.print(m_prompt); 21 | String text = m_stdIn.nextLine(); 22 | 23 | if (m_quitText.equals(text)) 24 | break; 25 | 26 | m_raf.writeUTF(text); 27 | } 28 | } 29 | 30 | private void runForRead() throws IOException 31 | { 32 | m_raf.seek(0); //Dosya göstericisini başa çektik 33 | try { 34 | for (;;) { 35 | String text = m_raf.readUTF(); 36 | 37 | System.out.println(text); 38 | } 39 | } 40 | catch (EOFException ignore) { 41 | 42 | } 43 | } 44 | 45 | public RandomAccessFileWriteFromStdIn(String path, String quitText, String prompt) throws IOException 46 | { 47 | this(path, new Scanner(System.in), quitText, prompt); 48 | } 49 | 50 | public RandomAccessFileWriteFromStdIn(String path, Scanner stdIn, String quitText, String prompt) throws IOException 51 | { 52 | m_raf = new RandomAccessFile(path, "rw"); 53 | m_stdIn = stdIn; 54 | m_quitText = quitText; 55 | m_prompt = prompt; 56 | } 57 | 58 | public void run() throws IOException 59 | { 60 | runForWrite(); 61 | runForRead(); 62 | } 63 | 64 | public void close() throws IOException 65 | { 66 | m_raf.close(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/io/file/randomaccess/RandomAccessFileWriteFromStdInApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.io.file.randomaccess; 2 | 3 | import java.io.IOException; 4 | 5 | import static org.csystem.util.console.CommandLineUtil.checkIfNotEqualAndExit; 6 | 7 | public final class RandomAccessFileWriteFromStdInApp { 8 | private RandomAccessFileWriteFromStdInApp() 9 | { 10 | } 11 | 12 | public static void run(String [] args) 13 | { 14 | checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 15 | try (RandomAccessFileWriteFromStdIn rs = new RandomAccessFileWriteFromStdIn(args[0], "quit", "Input a text:")) { 16 | rs.run(); 17 | } 18 | catch (IOException ex) { 19 | System.err.println("IO error occurs!..."); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/lotto/Lotto.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.lotto; 2 | 3 | import org.csystem.util.number.NumberUtil; 4 | 5 | import java.util.Random; 6 | 7 | public class Lotto { 8 | private final Random m_random; 9 | private boolean m_winGame1; 10 | private boolean m_winGame2; 11 | private boolean m_winGame3; 12 | 13 | private int randomValue() 14 | { 15 | return m_random.nextInt(99) + 1; 16 | } 17 | 18 | private int getFirst() 19 | { 20 | return randomValue(); 21 | } 22 | 23 | private int getSecond(int first) 24 | { 25 | int second = 0; 26 | 27 | while ((second = randomValue()) == first) 28 | ; 29 | 30 | return second; 31 | } 32 | 33 | private int getThird(int first, int second) 34 | { 35 | int third = 0; 36 | 37 | while ((third = randomValue()) == first || third == second) 38 | ; 39 | 40 | return third; 41 | } 42 | 43 | 44 | private void playGame1(int first, int second, int third) 45 | { 46 | m_winGame1 = first + second + third < 150; 47 | } 48 | 49 | private void playGame2(int first, int second, int third) 50 | { 51 | m_winGame2 = NumberUtil.isPrime(first + second + third); 52 | } 53 | 54 | private void playGame3(int first, int second, int third) 55 | { 56 | int min = Math.min(Math.min(first, second), third); 57 | int max = Math.max(Math.max(first, second), third); 58 | int mid = first + second + third - max - min; 59 | 60 | m_winGame3 = max - min > mid; 61 | } 62 | 63 | public Lotto() 64 | { 65 | this(new Random()); 66 | } 67 | 68 | public Lotto(Random r) 69 | { 70 | m_random = r; 71 | } 72 | 73 | public void play() 74 | { 75 | int first = getFirst(); 76 | int second = getSecond(first); 77 | int third = getThird(first, second); 78 | 79 | playGame1(first, second, third); 80 | playGame2(first, second, third); 81 | playGame3(first, second, third); 82 | } 83 | 84 | public boolean isWinGame1() 85 | { 86 | return m_winGame1; 87 | } 88 | 89 | public boolean isWinGame2() 90 | { 91 | return m_winGame2; 92 | } 93 | 94 | public boolean isWinGame3() 95 | { 96 | return m_winGame3; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/lotto/LottoProbabilitySimulation.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.lotto; 2 | 3 | public class LottoProbabilitySimulation { 4 | private 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 void run() 15 | { 16 | java.util.Random r = new java.util.Random(); 17 | Lotto lotto = new Lotto(r); 18 | int win1Count, win2Count, win3Count; 19 | 20 | win1Count= win2Count = win3Count = 0; 21 | 22 | for (int i = 0; i < m_count; ++i) { 23 | lotto.play(); 24 | 25 | if (lotto.isWinGame1()) 26 | ++win1Count; 27 | 28 | if (lotto.isWinGame2()) 29 | ++win2Count; 30 | 31 | if (lotto.isWinGame3()) 32 | ++win3Count; 33 | } 34 | 35 | m_game1Prob = (double)win1Count / m_count; 36 | m_game2Prob = (double)win2Count / m_count; 37 | m_game3Prob = (double)win3Count / m_count; 38 | } 39 | 40 | public int getCount() 41 | { 42 | return m_count; 43 | } 44 | 45 | public void setCount(int count) 46 | { 47 | m_count = count; 48 | } 49 | 50 | public double getGame1Prob() 51 | { 52 | return m_game1Prob; 53 | } 54 | 55 | public double getGame2Prob() 56 | { 57 | return m_game2Prob; 58 | } 59 | 60 | public double getGame3Prob() 61 | { 62 | return m_game3Prob; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/lotto/LottoProbabilitySimulationApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.lotto; 2 | 3 | class LottoProbabilitySimulationApp { 4 | private LottoProbabilitySimulationApp() 5 | { 6 | } 7 | 8 | public static void run() 9 | { 10 | java.util.Scanner kb = new java.util.Scanner(System.in); 11 | 12 | System.out.print("Bir sayı giriniz:"); 13 | int n = Integer.parseInt(kb.nextLine()); 14 | 15 | LottoProbabilitySimulation simulation = new LottoProbabilitySimulation(n); 16 | 17 | simulation.run(); 18 | 19 | System.out.printf("1. oyunun kazanma olasılığı:%f%n", simulation.getGame1Prob()); 20 | System.out.printf("2. oyunun kazanma olasılığı:%f%n", simulation.getGame2Prob()); 21 | System.out.printf("3. oyunun kazanma olasılığı:%f%n", simulation.getGame3Prob()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/numericlottery/NumericLottery.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.numericlottery; 2 | 3 | import java.util.Random; 4 | 5 | public class NumericLottery { 6 | private final Random m_random; 7 | 8 | private boolean [] getFlags() 9 | { 10 | boolean [] flags = new boolean[50]; 11 | 12 | for (int i = 0; i < 6; ++i) { 13 | int val; 14 | 15 | for (;;) { 16 | val = m_random.nextInt(49) + 1; 17 | if (!flags[val]) 18 | break; 19 | } 20 | flags[val] = true; 21 | } 22 | 23 | return flags; 24 | } 25 | 26 | private static int [] getNumbers(boolean[] flags) 27 | { 28 | int [] numbers = new int[6]; 29 | 30 | int idx = 0; 31 | 32 | for (int i = 1; i < 50; ++i) 33 | if (flags[i]) 34 | numbers[idx++] = i; 35 | 36 | return numbers; 37 | } 38 | 39 | public NumericLottery() 40 | { 41 | this(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 n) 55 | { 56 | int [][] numbers = new int[n][]; 57 | 58 | for (int i = 0; i < n; ++i) 59 | numbers[i] = getNumbers(); 60 | 61 | return numbers; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/numericlottery/NumericLotteryApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.numericlottery; 2 | 3 | import org.csystem.util.array.ArrayUtil; 4 | 5 | import java.util.Scanner; 6 | 7 | public class NumericLotteryApp { 8 | private NumericLotteryApp() 9 | { 10 | } 11 | 12 | public static void run() 13 | { 14 | Scanner kb = new Scanner(System.in); 15 | NumericLottery numericLottery = new NumericLottery(); 16 | 17 | for (;;) { 18 | System.out.print("Kaç tane kupon oynamak istiyorsunuz?"); 19 | int n = Integer.parseInt(kb.nextLine()); 20 | 21 | if (n <= 0) 22 | break; 23 | 24 | ArrayUtil.display(2, numericLottery.getNumbers(n)); 25 | } 26 | 27 | System.out.println("Tekrar yapıyor musunuz?"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/CharArraySource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class CharArraySource implements ISource { 4 | private final char[] m_chars; 5 | private int m_index; 6 | 7 | public CharArraySource(String str) 8 | { 9 | m_chars = str.toCharArray(); 10 | } 11 | 12 | public int nextChar() 13 | { 14 | return m_index == m_chars.length ? -1 : m_chars[m_index++]; 15 | } 16 | 17 | public void reset() 18 | { 19 | m_index = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/DigitParser.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class DigitParser extends Parser { 4 | 5 | public DigitParser() 6 | { 7 | } 8 | 9 | public DigitParser(ISource source) 10 | { 11 | super(source); 12 | //... 13 | 14 | } 15 | 16 | public ISource getSource() 17 | { 18 | return source; 19 | } 20 | 21 | public void setSource(ISource source) 22 | { 23 | //... 24 | this.source = source; 25 | } 26 | 27 | public int doParse() 28 | { 29 | try { 30 | source.reset(); 31 | int ch; 32 | int count = 0; 33 | 34 | while ((ch = source.nextChar()) != -1) 35 | if (Character.isDigit(ch)) 36 | ++count; 37 | 38 | return count; 39 | } 40 | catch (Exception ignore) { 41 | 42 | } 43 | 44 | return -1; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/DigitParserStdInSourceApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import java.util.Scanner; 4 | 5 | public final class DigitParserStdInSourceApp { 6 | private DigitParserStdInSourceApp() 7 | { 8 | } 9 | 10 | public static void run() 11 | { 12 | Scanner kb = new Scanner(System.in); 13 | ParseFactory factory = new ParseFactory(); 14 | 15 | for (;;) { 16 | System.out.print("Bir yazı giriniz:"); 17 | String s = kb.nextLine(); 18 | 19 | if ("elma".equals(s)) 20 | break; 21 | 22 | System.out.println("--------------------------------------------"); 23 | StringSource ss = new StringSource(s); 24 | CharArraySource cs = new CharArraySource(s); 25 | Parser parser = factory.getParser(ParserType.DIGIT, ss); 26 | 27 | System.out.printf("Rakam sayısı:%d%n", parser.doParse()); 28 | parser = factory.getParser(ParserType.DIGIT, cs); 29 | System.out.printf("Rakam sayısı:%d%n", parser.doParse()); 30 | System.out.println("--------------------------------------------"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/FileAsciiSource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | import java.nio.charset.StandardCharsets; 6 | import java.nio.file.Path; 7 | 8 | public class FileAsciiSource extends FileSource { 9 | public FileAsciiSource(String path) throws IOException 10 | { 11 | this(Path.of(path)); 12 | } 13 | 14 | public FileAsciiSource(Path path) throws IOException 15 | { 16 | super(path, StandardCharsets.US_ASCII); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/FileSource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.Closeable; 5 | import java.io.IOException; 6 | import java.nio.charset.Charset; 7 | import java.nio.charset.StandardCharsets; 8 | import java.nio.file.Files; 9 | import java.nio.file.Path; 10 | 11 | abstract public class FileSource implements ISource, Closeable { 12 | protected BufferedReader br; 13 | protected Charset charset; 14 | protected Path path; 15 | 16 | protected FileSource(String path) throws IOException 17 | { 18 | this(path, StandardCharsets.UTF_8); 19 | } 20 | 21 | protected FileSource(Path path) throws IOException 22 | { 23 | this(path, StandardCharsets.UTF_8); 24 | } 25 | 26 | protected FileSource(String path, Charset charset) throws IOException 27 | { 28 | this(Path.of(path), charset); 29 | } 30 | 31 | protected FileSource(Path path, Charset charset) throws IOException 32 | { 33 | this.path = path; 34 | this.charset = charset; 35 | br = Files.newBufferedReader(path, charset); 36 | } 37 | 38 | public int nextChar() throws IOException 39 | { 40 | return br.read(); 41 | } 42 | 43 | public void reset() throws IOException 44 | { 45 | br = Files.newBufferedReader(path, charset); 46 | } 47 | 48 | public void close() throws IOException 49 | { 50 | br.close(); 51 | } 52 | } 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/FileUTFSource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | import java.nio.charset.StandardCharsets; 6 | import java.nio.file.Path; 7 | 8 | public class FileUTFSource extends FileSource implements ISource, Closeable { 9 | public FileUTFSource(String path) throws IOException 10 | { 11 | this(Path.of(path)); 12 | } 13 | 14 | public FileUTFSource(Path path) throws IOException 15 | { 16 | super(path, StandardCharsets.UTF_8); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/ISource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public interface ISource { 4 | int nextChar() throws Exception; 5 | void reset() throws Exception; 6 | } 7 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/LetterParser.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class LetterParser extends Parser { 4 | public LetterParser() 5 | { 6 | } 7 | 8 | public LetterParser(ISource source) 9 | { 10 | super(source); 11 | //... 12 | } 13 | 14 | public ISource getSource() 15 | { 16 | return source; 17 | } 18 | 19 | public void setSource(ISource source) 20 | { 21 | //... 22 | this.source = source; 23 | } 24 | 25 | public int doParse() 26 | { 27 | try { 28 | source.reset(); 29 | int count = 0; 30 | 31 | int ch; 32 | 33 | while ((ch = source.nextChar()) != -1) { 34 | System.out.print((char)ch); 35 | if (Character.isLetter(ch)) 36 | ++count; 37 | } 38 | 39 | System.out.println(); 40 | return count; 41 | } 42 | catch (Exception ex) { 43 | ex.printStackTrace(); 44 | } 45 | 46 | return -1; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/LetterParserFileAsciiSourceApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | 8 | public final class LetterParserFileAsciiSourceApp { 9 | private LetterParserFileAsciiSourceApp() 10 | { 11 | } 12 | 13 | public static void run(String [] args) 14 | { 15 | CommandLineUtil.checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 16 | 17 | ParseFactory factory = new ParseFactory(); 18 | 19 | try (FileAsciiSource fs = new FileAsciiSource(args[0])) { 20 | Parser parser = factory.getParser(ParserType.LETTER, fs); 21 | 22 | System.out.printf("Number of Letters:%d%n", parser.doParse()); 23 | } 24 | catch (FileNotFoundException ignore) { 25 | System.err.println("File Not found"); 26 | } 27 | catch (IOException ignore) { 28 | System.err.println(); 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/LetterParserFileSourceApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import org.csystem.util.console.CommandLineUtil; 4 | 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | 8 | public final class LetterParserFileSourceApp { 9 | private LetterParserFileSourceApp() 10 | { 11 | } 12 | 13 | public static void run(String [] args) 14 | { 15 | CommandLineUtil.checkIfNotEqualAndExit(args, 1, "Wrong number of arguments"); 16 | 17 | ParseFactory factory = new ParseFactory(); 18 | 19 | try (FileUTFSource fs = new FileUTFSource(args[0])) { 20 | Parser parser = factory.getParser(ParserType.LETTER, fs); 21 | 22 | System.out.printf("Number of Letters:%d%n", parser.doParse()); 23 | } 24 | catch (FileNotFoundException ignore) { 25 | System.err.println("File Not found"); 26 | } 27 | catch (IOException ignore) { 28 | System.err.println(); 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/ParseFactory.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class ParseFactory { 4 | //... 5 | public Parser getParser(ParserType parserType, ISource source) 6 | { 7 | Parser parser = null; 8 | 9 | switch (parserType) { 10 | case DIGIT: 11 | parser = new DigitParser(source); 12 | break; 13 | 14 | case LETTER: 15 | parser = new LetterParser(source); 16 | break; 17 | case WHITESPACE: 18 | parser = new WhitespaceParser(source); 19 | break; 20 | } 21 | 22 | return parser; 23 | } 24 | //... 25 | } 26 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/Parser.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public abstract class Parser { 4 | protected ISource source; 5 | 6 | public Parser() 7 | { 8 | } 9 | 10 | public Parser(ISource source) 11 | { 12 | //... 13 | this.source = source; 14 | } 15 | 16 | public abstract int doParse(); 17 | } 18 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/ParserType.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public enum ParserType { 4 | WHITESPACE, DIGIT, LETTER 5 | } 6 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/StringSource.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class StringSource implements ISource { 4 | private final String m_str; 5 | private int m_index; 6 | 7 | public StringSource(String str) 8 | { 9 | m_str = str; 10 | } 11 | 12 | public int nextChar() 13 | { 14 | return m_index == m_str.length() ? -1 : m_str.charAt(m_index++); 15 | } 16 | 17 | public void reset() 18 | { 19 | m_index = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/WhitespaceParser.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | public class WhitespaceParser extends Parser { 4 | public WhitespaceParser() 5 | { 6 | } 7 | 8 | public WhitespaceParser(ISource source) 9 | { 10 | super(source); 11 | //... 12 | } 13 | 14 | public ISource getSource() 15 | { 16 | return source; 17 | } 18 | 19 | public void setSource(ISource source) 20 | { 21 | //... 22 | this.source = source; 23 | } 24 | 25 | public int doParse() 26 | { 27 | try { 28 | source.reset(); 29 | int count = 0; 30 | 31 | int ch; 32 | 33 | while ((ch = source.nextChar()) != -1) 34 | if (Character.isWhitespace(ch)) 35 | ++count; 36 | 37 | return count; 38 | } 39 | catch (Exception ignore) { 40 | 41 | } 42 | 43 | return -1; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/parser/WhitespaceParserStdInSourceApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.parser; 2 | 3 | import java.util.Scanner; 4 | 5 | public final class WhitespaceParserStdInSourceApp { 6 | private WhitespaceParserStdInSourceApp() 7 | { 8 | } 9 | 10 | public static void run() 11 | { 12 | Scanner kb = new Scanner(System.in); 13 | ParseFactory factory = new ParseFactory(); 14 | 15 | 16 | for (;;) { 17 | System.out.print("Bir yazı giriniz:"); 18 | String s = kb.nextLine(); 19 | 20 | if ("elma".equals(s)) 21 | break; 22 | 23 | System.out.println("--------------------------------------------"); 24 | StringSource ss = new StringSource(s); 25 | CharArraySource cs = new CharArraySource(s); 26 | Parser parser = factory.getParser(ParserType.WHITESPACE, ss); 27 | 28 | System.out.printf("Boşluk sayısı:%d%n", parser.doParse()); 29 | parser = factory.getParser(ParserType.WHITESPACE, cs); 30 | System.out.printf("Boşluk sayısı:%d%n", parser.doParse()); 31 | System.out.println("--------------------------------------------"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/randomgenerator/RandomObjectArrayFactory.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.randomgenerator; 2 | 3 | import org.csystem.util.array.ArrayUtil; 4 | import org.csystem.util.datetime.Date; 5 | import org.csystem.util.math.Fraction; 6 | import org.csystem.util.math.geometry.Point; 7 | import org.csystem.util.string.StringUtil; 8 | 9 | import java.util.Random; 10 | 11 | public class RandomObjectArrayFactory { 12 | private final Random m_random; 13 | 14 | //String, Fraction, Date, int [], Point, Integer, Double, Character 15 | private Object createObject() 16 | { 17 | Object object; 18 | 19 | switch (m_random.nextInt(8)) { 20 | case 0: 21 | object = StringUtil.getRandomTextTR(m_random, m_random.nextInt(10) + 1); 22 | break; 23 | case 1: 24 | object = new Fraction(m_random.nextInt(10) - 5, m_random.nextInt(10) + 1); 25 | break; 26 | case 2: 27 | object = Date.random(m_random); 28 | break; 29 | case 3: 30 | object = ArrayUtil.getRandomArray(m_random, m_random.nextInt(10) + 5, 0, 99); 31 | break; 32 | case 4: 33 | object = m_random.nextInt(100); 34 | break; 35 | case 5: 36 | object = m_random.nextDouble(); 37 | break; 38 | case 6: 39 | object = (char) (m_random.nextInt(26) + (m_random.nextBoolean() ? 'A' : 'a')); 40 | break; 41 | default: 42 | object = Point.createCartesian(m_random.nextInt(200) - 100, m_random.nextInt(200) - 100); 43 | } 44 | 45 | return object; 46 | } 47 | 48 | private Object [] fillObjects(Object [] objects) 49 | { 50 | for (int i = 0; i < objects.length; ++i) 51 | objects[i] = createObject(); 52 | 53 | return objects; 54 | } 55 | 56 | public RandomObjectArrayFactory() 57 | { 58 | this(new Random()); 59 | } 60 | 61 | public RandomObjectArrayFactory(Random random) 62 | { 63 | m_random = random; 64 | } 65 | 66 | public Object[] getObjects(int count) 67 | { 68 | return fillObjects(new Object[count]); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/randomgenerator/RandomObjectArrayGeneratorApp.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.randomgenerator; 2 | 3 | import org.csystem.util.array.ArrayUtil; 4 | import org.csystem.util.datetime.Date; 5 | import org.csystem.util.math.Fraction; 6 | import org.csystem.util.math.geometry.Point; 7 | 8 | import java.util.Random; 9 | import java.util.Scanner; 10 | 11 | public class RandomObjectArrayGeneratorApp { 12 | private RandomObjectArrayGeneratorApp() 13 | {} 14 | 15 | public static void run() 16 | { 17 | Random random = new Random(); 18 | RandomObjectArrayFactory factory = new RandomObjectArrayFactory(random); 19 | Scanner kb = new Scanner(System.in); 20 | System.out.print("Dizinin eleman sayısını giriniz:"); 21 | int count = Integer.parseInt(kb.nextLine()); 22 | 23 | for (Object object : factory.getObjects(count)) { 24 | System.out.println("--------------------------------------------------"); 25 | String typeName = object.getClass().getName(); 26 | System.out.printf("Dinamik tür ismi:%s%n", typeName); 27 | 28 | if (object instanceof String) { 29 | String s = (String)object; 30 | 31 | System.out.println(s.toUpperCase()); 32 | } 33 | else if (object instanceof Fraction) { 34 | Fraction f = (Fraction)object; 35 | 36 | System.out.println(f.toString()); 37 | } 38 | else if (object instanceof Date) { 39 | Date date = (Date)object; 40 | 41 | System.out.println(date.toLongDateStringTR()); 42 | } 43 | else if (object instanceof int[]) { 44 | int [] a = (int[])object; 45 | 46 | ArrayUtil.display(2, a); 47 | } 48 | else if (object instanceof Integer) { 49 | int val = (int)object; 50 | 51 | System.out.printf("val = %d%n", val); 52 | } 53 | else if (object instanceof Double) { 54 | double val = (double) object; 55 | 56 | System.out.printf("val = %f%n", val); 57 | } 58 | else if (object instanceof Character) { 59 | char ch = (char)object; 60 | 61 | System.out.printf("ch = %c%n", ch); 62 | } 63 | else { 64 | Point p = (Point)object; 65 | 66 | System.out.println(p.toString()); 67 | p.offset(20); 68 | System.out.println(p.toString()); 69 | } 70 | System.out.println("--------------------------------------------------"); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/studentinfoparser/StudentInfo.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.studentinfoparser; 2 | 3 | import org.csystem.util.datetime.Date; 4 | 5 | public class StudentInfo { 6 | private String m_name; 7 | private Date m_birthDate; 8 | private String m_lectureName; 9 | private int m_midtermGrade; 10 | private int m_finalGrade; 11 | 12 | //... 13 | 14 | 15 | public String getName() 16 | { 17 | return m_name; 18 | } 19 | 20 | public void setName(String name) 21 | { 22 | m_name = name; 23 | } 24 | 25 | public Date getBirthDate() 26 | { 27 | return m_birthDate; 28 | } 29 | 30 | public void setBirthDate(Date birthDate) 31 | { 32 | m_birthDate = birthDate; 33 | } 34 | 35 | public String getLectureName() 36 | { 37 | return m_lectureName; 38 | } 39 | 40 | public void setLectureName(String lectureName) 41 | { 42 | m_lectureName = lectureName; 43 | } 44 | 45 | public int getMidtermGrade() 46 | { 47 | return m_midtermGrade; 48 | } 49 | 50 | public void setMidtermGrade(int midtermGrade) 51 | { 52 | m_midtermGrade = midtermGrade; 53 | } 54 | 55 | public int getFinalGrade() 56 | { 57 | return m_finalGrade; 58 | } 59 | 60 | public void setFinalGrade(int finalGrade) 61 | { 62 | m_finalGrade = finalGrade; 63 | } 64 | 65 | public double getGrade() 66 | { 67 | return m_midtermGrade * 0.4 + m_finalGrade * 0.6; 68 | } 69 | 70 | 71 | public String toString() 72 | { 73 | double grade = getGrade(); 74 | 75 | String fmt = "{name: %s, birthDate: %s, lectureName: %s, midterm: %d, final: %d, grade:%.1f, status: %s}"; 76 | 77 | return String.format(fmt, m_name, m_birthDate.toLongDateStringTR(), m_lectureName, m_midtermGrade, m_finalGrade, grade, grade >= 50 ? "Geçti" : "Kaldı"); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/studentinfoparser/StudentInfoParser.java: -------------------------------------------------------------------------------- 1 | package org.csystem.application.studentinfoparser; 2 | 3 | import org.csystem.util.datetime.Date; 4 | 5 | public class StudentInfoParser { 6 | private final StudentInfo m_studentInfo; 7 | 8 | private static Date getBirthDate(String str) 9 | { 10 | String [] birthDateInfo = str.split("[/]"); 11 | int day = Integer.parseInt(birthDateInfo[0]); 12 | int month = Integer.parseInt(birthDateInfo[1]); 13 | int year = Integer.parseInt(birthDateInfo[2]); 14 | 15 | return new Date(day, month, year); 16 | } 17 | 18 | 19 | public StudentInfoParser(String str) 20 | { 21 | /* 22 | :::: 23 | Oğuz Karan:10/09/1976:Matematik:54:78 24 | Büşra Uludağ Polat:09/08/1994:Programlamaya Giriş:89:100 25 | Furkan Genç:02/11/2006:Tarih:78:98 26 | */ 27 | 28 | String [] studentInfoStr = str.split("[:]+"); 29 | 30 | //... 31 | 32 | m_studentInfo = new StudentInfo(); 33 | m_studentInfo.setName( studentInfoStr[0]); 34 | m_studentInfo.setBirthDate(getBirthDate(studentInfoStr[1])); 35 | m_studentInfo.setLectureName(studentInfoStr[2]); 36 | m_studentInfo.setMidtermGrade(Integer.parseInt(studentInfoStr[3])); 37 | m_studentInfo.setFinalGrade(Integer.parseInt(studentInfoStr[4])); 38 | } 39 | 40 | public StudentInfo getStudentInfo() 41 | { 42 | return m_studentInfo; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/application/studentinfoparser/StudentInfoParserApp.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | Sınıf Çalışması: Klavyeden aşağıdak formatta girilen bilgiyi ayrıştırarak ekrana sonuçları yazdıran programı yazınız: 3 | :::: 4 | Oğuz Karan:10/09/1976:Matematik:54:78 5 | Büşra Uludağ Polat:09/08/1994:Programlamaya Giriş:89:100 6 | Furkan Genç:02/11/2006:Tarih:78:98 7 | Oğuz Karan:10/09/1976:Kimya:55:20 8 | Açıklamalar: 9 | - Format geçerlilik kontrolü yapılmayacaktır 10 | - Formatta kişinin vize ve final notlarına göre vize * 0.4 + final * 0.6 formülüne göre geçme notu hesaplanacak 11 | ve doğum tarihinin hangi güne geldiği de belirlenerek ekrana geçti-kaldı bilgisiyle beraber yazılacaktır 12 | - Geçme notu >= 50 ise öğrenci geçecek, değilse kalacaktır 13 | - İleride daha iyisi yazılacaktır 14 | ----------------------------------------------------------------------------------------------------------------------*/ 15 | package org.csystem.application.studentinfoparser; 16 | 17 | import java.util.Scanner; 18 | 19 | public class StudentInfoParserApp { 20 | private StudentInfoParserApp() 21 | { 22 | } 23 | 24 | public static void run() 25 | { 26 | Scanner kb = new Scanner(System.in); 27 | 28 | for (;;) { 29 | System.out.print("Formatlı yazıyı giriniz:"); 30 | String str = kb.nextLine(); 31 | 32 | if ("elma".equals(str)) 33 | break; 34 | 35 | StudentInfoParser parser = new StudentInfoParser(str); 36 | StudentInfo studentInfo = parser.getStudentInfo(); 37 | 38 | System.out.println(studentInfo.toString()); 39 | } 40 | 41 | System.out.println("Tekrar yapıyor musunuz?"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/collection/CSDArrayList.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : CSDArrayList.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 22.01.2022 5 | 6 | CSDArrayList class that represents dynamic array 7 | 8 | Note: String concatenation cost ignored for future implementations 9 | 10 | Copyleft (c) 1993 by C and System Programmers Association (CSD) 11 | All Rights Free 12 | -----------------------------------------------------------------------*/ 13 | package org.csystem.util.collection; 14 | 15 | public class CSDArrayList { 16 | private static final int DEFAULT_CAPACITY = 10; 17 | private E [] m_elems; 18 | private int m_index; 19 | 20 | private static void doWorkForIllegalArgumentException(String message) 21 | { 22 | throw new IllegalArgumentException(message); 23 | } 24 | 25 | private static void doWorkForIndexOutOfBoundsException(String message) 26 | { 27 | throw new IndexOutOfBoundsException(message); 28 | } 29 | 30 | private static void checkCapacity(int capacity) 31 | { 32 | if (capacity < 0) 33 | doWorkForIllegalArgumentException("Capacity value can not be negative:" + capacity); 34 | } 35 | 36 | private void checkIndex(int index) 37 | { 38 | if (index < 0 || index >= m_index) 39 | doWorkForIndexOutOfBoundsException("Index out of range:" + index); 40 | } 41 | 42 | private void changeCapacity(int capacity) 43 | { 44 | E [] temp = (E[])new Object[capacity]; 45 | 46 | System.arraycopy(m_elems, 0, temp, 0, m_index); 47 | m_elems = temp; 48 | } 49 | 50 | public CSDArrayList() 51 | { 52 | m_elems = (E[])new Object[DEFAULT_CAPACITY]; 53 | } 54 | 55 | public CSDArrayList(int initialCapacity) 56 | { 57 | checkCapacity(initialCapacity); 58 | m_elems = (E[])new Object[initialCapacity]; 59 | } 60 | 61 | public boolean add(E elem) 62 | { 63 | if (m_elems.length == m_index) 64 | changeCapacity(m_elems.length == 0 ? 1 : m_elems.length * 2); 65 | 66 | m_elems[m_index++] = elem; 67 | 68 | return true; 69 | } 70 | 71 | public void add(int index, E elem) 72 | { 73 | if (m_elems.length == m_index) 74 | changeCapacity(m_elems.length == 0 ? 1 : m_elems.length * 2); 75 | 76 | //TODO: 77 | } 78 | 79 | public int capacity() 80 | { 81 | return m_elems.length; 82 | } 83 | 84 | public void clear() 85 | { 86 | for (int i = 0; i < m_index; ++i) 87 | m_elems[i] = null; 88 | 89 | m_index = 0; 90 | } 91 | 92 | public void ensureCapacity(int minCapacity) 93 | { 94 | if (minCapacity > m_elems.length) 95 | changeCapacity(Math.max(m_elems.length * 2, minCapacity)); 96 | } 97 | 98 | public E get(int index) 99 | { 100 | checkIndex(index); 101 | 102 | return m_elems[index]; 103 | } 104 | 105 | public boolean isEmpty() 106 | { 107 | return m_index == 0; 108 | } 109 | 110 | public E remove(int index) 111 | { 112 | //... 113 | E oldVal = m_elems[index]; 114 | 115 | //TODO: 116 | 117 | return oldVal; 118 | } 119 | 120 | public E set(int index, E elem) 121 | { 122 | checkIndex(index); 123 | 124 | E oldElem = m_elems[index]; 125 | 126 | m_elems[index] = elem; 127 | 128 | return oldElem; 129 | } 130 | 131 | public int size() 132 | { 133 | return m_index; 134 | } 135 | 136 | public void trimToSize() 137 | { 138 | if (m_index != m_elems.length) 139 | changeCapacity(m_index); 140 | } 141 | 142 | public String toString() 143 | { 144 | String str = "["; 145 | 146 | for (int i = 0; i < m_index; ++i) { 147 | if (str.length() != 1) 148 | str += ", "; 149 | 150 | str += m_elems[i]; 151 | } 152 | 153 | return str + "]"; 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/console/CommandLineUtil.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : CommandLineUtil.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 12.12.2021 5 | 6 | Utility class that simplifies the operations of command line 7 | arguments 8 | 9 | Copyleft (c) 1993 by C and System Programmers Association (CSD) 10 | All Rights Free 11 | -----------------------------------------------------------------------*/ 12 | package org.csystem.util.console; 13 | 14 | import java.util.Scanner; 15 | 16 | public final class CommandLineUtil { 17 | private static final Scanner ms_kb = new Scanner(System.in); 18 | 19 | private CommandLineUtil() 20 | {} 21 | 22 | public static boolean checkIfEqual(String [] args, int n) 23 | { 24 | return args.length == n; 25 | } 26 | 27 | public static boolean checkIfNotEqual(String [] args, int n) 28 | { 29 | return !checkIfEqual(args, n); 30 | } 31 | 32 | public static void checkIfEqualAndExit(String [] args, int n, String message) 33 | { 34 | if (checkIfEqual(args, n)) { 35 | System.err.println(message); 36 | System.exit(1); 37 | } 38 | } 39 | 40 | public static void checkIfNotEqualAndExit(String [] args, int n, String message) 41 | { 42 | if (checkIfNotEqual(args, n)) { 43 | System.err.println(message); 44 | System.exit(1); 45 | } 46 | } 47 | 48 | public static boolean checkIfGreater(String [] args, int n) 49 | { 50 | return !checkIfLessOrEqual(args, n); 51 | } 52 | 53 | public static boolean checkIfGreaterOrEqual(String [] args, int n) 54 | { 55 | return !checkIfLess(args, n); 56 | } 57 | 58 | public static void checkIfGreaterAndExit(String [] args, int n, String message) 59 | { 60 | if (checkIfGreater(args, n)) { 61 | System.err.println(message); 62 | System.exit(1); 63 | } 64 | } 65 | 66 | public static void checkIfGreaterOrEqualAndExit(String [] args, int n, String message) 67 | { 68 | if (checkIfGreaterOrEqual(args, n)) { 69 | System.err.println(message); 70 | System.exit(1); 71 | } 72 | } 73 | 74 | public static boolean checkIfLess(String [] args, int n) 75 | { 76 | return args.length < n; 77 | } 78 | 79 | public static boolean checkIfLessOrEqual(String [] args, int n) 80 | { 81 | return args.length <= n; 82 | } 83 | 84 | public static void checkIfLessAndExit(String [] args, int n, String message) 85 | { 86 | if (checkIfLess(args, n)) { 87 | System.err.println(message); 88 | System.exit(1); 89 | } 90 | } 91 | 92 | public static void checkIfLessOrEqualAndExit(String [] args, int n, String message) 93 | { 94 | if (checkIfLessOrEqual(args, n)) { 95 | System.err.println(message); 96 | System.exit(1); 97 | } 98 | } 99 | 100 | public static String [] getArgumentsWithoutParse(String [] args, String prompt) 101 | { 102 | if (args.length != 0) 103 | return args; 104 | 105 | System.out.print(prompt); 106 | return new String[] {ms_kb.nextLine()}; 107 | } 108 | 109 | public static String [] getArguments(String [] args, String prompt) 110 | { 111 | if (args.length != 0) 112 | return args; 113 | 114 | System.out.print(prompt); 115 | return ms_kb.nextLine().split("[ \t]+"); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/console/Console.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : StringUtil.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 08.01.2022 5 | 6 | Console class that is used 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; 17 | 18 | static { 19 | ms_kb = new Scanner(System.in); 20 | } 21 | private Console() 22 | {} 23 | 24 | public static int readInt() 25 | { 26 | return readInt(""); 27 | } 28 | 29 | public static int readInt(String message) 30 | { 31 | return readInt(message, ""); 32 | } 33 | 34 | public static int readInt(String message, String errMessage) 35 | { 36 | for (;;) { 37 | try { 38 | System.out.print(message); 39 | return Integer.parseInt(ms_kb.nextLine()); 40 | } 41 | catch (NumberFormatException ignore) { 42 | System.out.print(errMessage); 43 | } 44 | } 45 | } 46 | 47 | public static int readIntLine(String message) 48 | { 49 | return readInt(message + '\n'); 50 | } 51 | 52 | public static int readIntLine(String message, String errMessage) 53 | { 54 | return readInt(message + '\n', errMessage + '\n'); 55 | } 56 | 57 | public static double readDouble() 58 | { 59 | return readDouble(""); 60 | } 61 | 62 | public static double readDouble(String message) 63 | { 64 | return readDouble(message, ""); 65 | } 66 | 67 | public static double readDouble(String message, String errMessage) 68 | { 69 | for (;;) { 70 | try { 71 | System.out.print(message); 72 | return Double.parseDouble(ms_kb.nextLine()); 73 | } 74 | catch (NumberFormatException ignore) { 75 | System.out.print(errMessage); 76 | } 77 | } 78 | } 79 | 80 | public static double readDoubleLine(String message) 81 | { 82 | return readInt(message + '\n'); 83 | } 84 | 85 | public static double readDoubleLine(String message, String errMessage) 86 | { 87 | return readInt(message + '\n', errMessage + '\n'); 88 | } 89 | 90 | public static String read(String message) 91 | { 92 | System.out.print(message); 93 | return ms_kb.nextLine(); 94 | } 95 | 96 | public static String readLine() 97 | { 98 | return ms_kb.nextLine(); 99 | } 100 | 101 | //... 102 | } 103 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/datetime/DateTime.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : DateTime.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 06.11.2021 5 | 6 | DateTime class for date and 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 DateTime { 16 | private final Date m_date; 17 | private final Time m_time; 18 | 19 | public static DateTime random() 20 | { 21 | return random(new Random(), new Date().getYear()); 22 | } 23 | 24 | public static DateTime random(Random r) 25 | { 26 | return random(r, new Date().getYear()); 27 | } 28 | 29 | public static DateTime random(int year) 30 | { 31 | return random(new Random(), year, year); 32 | } 33 | 34 | public static DateTime random(Random r, int year) 35 | { 36 | return random(r, year, year); 37 | } 38 | 39 | public static DateTime random(int minYear, int maxYear) 40 | { 41 | return random(new Random(), minYear, maxYear); 42 | } 43 | 44 | public static DateTime random(Random r, int minYear, int maxYear) 45 | { 46 | return new DateTime(Date.random(r, minYear, maxYear), Time.random(r)); 47 | } 48 | 49 | public DateTime() 50 | { 51 | m_date = new Date(); 52 | m_time = new Time(); 53 | } 54 | 55 | public DateTime(Date date, Time time) 56 | { 57 | this(date.getDay(), date.getMonth(), date.getYear(), time.getHour(), time.getMinute(), time.getSecond(), time.getMillisecond()); 58 | } 59 | 60 | public DateTime(int day, Month month, int year) 61 | { 62 | this(day, month, year, 0, 0); 63 | } 64 | 65 | 66 | public DateTime(int day, Month month, int year, int hour, int minute) 67 | { 68 | this(day, month, year, hour, minute, 0); 69 | } 70 | 71 | public DateTime(int day, Month month, int year, int hour, int minute, int second) 72 | { 73 | this(day, month, year, hour, minute, second, 0); 74 | } 75 | 76 | public DateTime(int day, Month month, int year, int hour, int minute, int second, int millisecond) 77 | { 78 | m_date = new Date(day, month, year); 79 | m_time = new Time(hour, minute, second, millisecond); 80 | } 81 | 82 | public int getDay() 83 | { 84 | return m_date.getDay(); 85 | } 86 | 87 | public void setDay(int day) 88 | { 89 | m_date.setDay(day); 90 | } 91 | 92 | public int getMonthValue() 93 | { 94 | return m_date.getMonthValue(); 95 | } 96 | 97 | public void setMonthValue(int month) 98 | { 99 | m_date.setMonthValue(month); 100 | } 101 | 102 | public Month getMonth() 103 | { 104 | return m_date.getMonth(); 105 | } 106 | 107 | public void setMonth(Month month) 108 | { 109 | m_date.setMonth(month); 110 | } 111 | 112 | public int getYear() 113 | { 114 | return m_date.getYear(); 115 | } 116 | 117 | public void setYear(int year) 118 | { 119 | m_date.setYear(year); 120 | } 121 | 122 | public DayOfWeek getDayOfWeek() 123 | { 124 | return m_date.getDayOfWeek(); 125 | } 126 | 127 | public String getDayOfWeekTR() 128 | { 129 | return m_date.getDayOfWeekTR(); 130 | } 131 | 132 | public String getDayOfWeekEN() 133 | { 134 | return m_date.getDayOfWeekEN(); 135 | } 136 | 137 | public boolean isLeapYear() 138 | { 139 | return m_date.isLeapYear(); 140 | } 141 | 142 | public boolean isWeekend() 143 | { 144 | return m_date.isWeekend(); 145 | } 146 | 147 | public boolean isWeekday() 148 | { 149 | return m_date.isWeekday(); 150 | } 151 | 152 | public int getDaysOfMonth() 153 | { 154 | return m_date.getDaysOfMonth(); 155 | } 156 | 157 | public String toString(char delimiter) 158 | { 159 | return m_date.toString(delimiter); 160 | } 161 | 162 | public String toLongDateStringTR() 163 | { 164 | return m_date.toLongDateStringTR(); 165 | } 166 | 167 | public String toLongDateStringEN() 168 | { 169 | return m_date.toLongDateStringEN(); 170 | } 171 | 172 | public String toShortDateStringTR() 173 | { 174 | return m_date.toShortDateStringTR(); 175 | } 176 | 177 | public String toShortDateStringEN() 178 | { 179 | return m_date.toShortDateStringEN(); 180 | } 181 | 182 | public int getHour() 183 | { 184 | return m_time.getHour(); 185 | } 186 | 187 | public void setHour(int val) 188 | { 189 | m_time.setHour(val); 190 | } 191 | 192 | public int getMinute() 193 | { 194 | return m_time.getMinute(); 195 | } 196 | 197 | public void setMinute(int val) 198 | { 199 | m_time.setMinute(val); 200 | } 201 | 202 | public int getSecond() 203 | { 204 | return m_time.getSecond(); 205 | } 206 | 207 | public void setSecond(int val) 208 | { 209 | m_time.setSecond(val); 210 | } 211 | 212 | public int getMillisecond() 213 | { 214 | return m_time.getMillisecond(); 215 | } 216 | 217 | public void setMillisecond(int val) 218 | { 219 | m_time.setMillisecond(val); 220 | } 221 | 222 | public String toShortTimeString() 223 | { 224 | return m_time.toShortTimeString(); 225 | } 226 | 227 | public String toLongTimeString() 228 | { 229 | return m_time.toLongTimeString(); 230 | } 231 | 232 | public String toLongDateTimeStringTR() 233 | { 234 | return String.format("%s %s", m_date.toLongDateStringTR(), m_time.toLongTimeString()); 235 | } 236 | 237 | public String toLongDateTimeStringEN() 238 | { 239 | return String.format("%s %s", m_date.toLongDateStringEN(), m_time.toLongTimeString()); 240 | } 241 | 242 | public String toString() 243 | { 244 | return String.format("%s %s", m_date.toString(), m_time.toString()); 245 | } 246 | 247 | public String toStringTR() 248 | { 249 | return String.format("%s %s", m_date.toShortDateStringTR(), m_time.toString()); 250 | } 251 | 252 | public String toStringEN() 253 | { 254 | return String.format("%s %s", m_date.toShortDateStringEN(), m_time.toString()); 255 | } 256 | } 257 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/datetime/DateTimeException.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : DateTimeException.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 05.12.2021 5 | 6 | Class that is used for exceptions of date and/or time 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("DateTime Exception:%s", super.getMessage()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/datetime/DayOfWeek.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : DayOfWeek.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 24.10.2021 5 | 6 | enum class that represents 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 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/datetime/Month.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Month.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 24.10.2021 5 | 6 | enum class that represents 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 | Month(int days) 17 | { 18 | this.days = days; 19 | } 20 | 21 | final int days; 22 | 23 | int getDays(int year) 24 | { 25 | return ordinal() == 1 && Date.isLeapYear(year) ? 29 : days; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/datetime/Time.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Time.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 05.12.2021 5 | 6 | Time 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.Calendar; 14 | import java.util.GregorianCalendar; 15 | import java.util.Random; 16 | 17 | public class Time { 18 | private int m_hour; 19 | private int m_minute; 20 | private int m_second; 21 | private int m_millisecond; 22 | 23 | private static void doWorkForException(String message) 24 | { 25 | throw new DateTimeException(message); 26 | } 27 | 28 | private static boolean isValidForBound(int val, int bound) 29 | { 30 | return 0 <= val && val <= bound; 31 | } 32 | 33 | private static boolean isValidForHour(int val) 34 | { 35 | return isValidForBound(val, 23); 36 | } 37 | 38 | private static boolean isValidForMinute(int val) 39 | { 40 | return isValidForBound(val, 59); 41 | } 42 | 43 | private static boolean isValidForSecond(int val) 44 | { 45 | return isValidForBound(val, 59); 46 | } 47 | 48 | private static boolean isValidForMillisecond(int val) 49 | { 50 | return isValidForBound(val, 999); 51 | } 52 | 53 | private static boolean isValidForTime(int hour, int minute, int second, int millisecond) 54 | { 55 | return isValidForHour(hour) && isValidForMinute(minute) 56 | && isValidForSecond(second) && isValidForMillisecond(millisecond); 57 | } 58 | 59 | private static void checkForHour(int val) 60 | { 61 | if (!isValidForHour(val)) 62 | doWorkForException("Invalid hour value:" + val); 63 | } 64 | 65 | private static void checkForMinute(int val) 66 | { 67 | if (!isValidForMinute(val)) 68 | doWorkForException("Invalid minute value:" + val); 69 | } 70 | 71 | private static void checkForSecond(int val) 72 | { 73 | if (!isValidForSecond(val)) 74 | doWorkForException("Invalid second value:" + val); 75 | } 76 | 77 | private static void checkForMillisecond(int val) 78 | { 79 | if (!isValidForMillisecond(val)) 80 | doWorkForException("Invalid millisecond value:" + val); 81 | } 82 | 83 | private static void checkForTime(int hour, int minute, int second, int millisecond) 84 | { 85 | if (!isValidForTime(hour, minute, second, millisecond)) 86 | doWorkForException(String.format("Invalid time value or values-> hour:%d, minute:%d, second:%d, millisecond:%d", 87 | hour, minute, second, millisecond)); 88 | } 89 | 90 | public static Time random() 91 | { 92 | return random(new Random()); 93 | } 94 | 95 | public static Time random(Random r) 96 | { 97 | return new Time(r.nextInt(24), r.nextInt(60), r.nextInt(60), r.nextInt(1000)); 98 | } 99 | 100 | public Time() //Burada yazılanların şu an için bilinmesi gerekmez. Sadece default ctor'un anlamına odaklanınız 101 | { 102 | Calendar now = new GregorianCalendar(); 103 | 104 | m_hour = now.get(Calendar.HOUR_OF_DAY); 105 | m_minute = now.get(Calendar.MINUTE); 106 | m_second = now.get(Calendar.SECOND); 107 | m_millisecond = now.get(Calendar.MILLISECOND); 108 | } 109 | 110 | public Time(int hour, int minute) 111 | { 112 | this(hour, minute, 0); 113 | } 114 | 115 | public Time(int hour, int minute, int second) 116 | { 117 | this(hour, minute, second, 0); 118 | } 119 | 120 | public Time(int hour, int minute, int second, int millisecond) 121 | { 122 | checkForTime(hour, minute, second, millisecond); 123 | m_hour = hour; 124 | m_minute = minute; 125 | m_second = second; 126 | m_millisecond = millisecond; 127 | } 128 | 129 | public int getHour() 130 | { 131 | return m_hour; 132 | } 133 | 134 | public void setHour(int val) 135 | { 136 | if (val == m_hour) 137 | return; 138 | 139 | checkForHour(val); 140 | m_hour = val; 141 | } 142 | 143 | public int getMinute() 144 | { 145 | return m_minute; 146 | } 147 | 148 | public void setMinute(int val) 149 | { 150 | if (val == m_minute) 151 | return; 152 | 153 | checkForMinute(val); 154 | m_minute = val; 155 | } 156 | 157 | public int getSecond() 158 | { 159 | return m_second; 160 | } 161 | 162 | public void setSecond(int val) 163 | { 164 | if (val == m_second) 165 | return; 166 | 167 | checkForSecond(val); 168 | m_second = val; 169 | } 170 | 171 | public int getMillisecond() 172 | { 173 | return m_millisecond; 174 | } 175 | 176 | public void setMillisecond(int val) 177 | { 178 | if (val == m_millisecond) 179 | return; 180 | 181 | checkForMillisecond(val); 182 | m_millisecond = val; 183 | } 184 | 185 | public String toString() 186 | { 187 | return String.format("%s:%02d", this.toShortTimeString(), m_second); 188 | } 189 | 190 | public String toShortTimeString() 191 | { 192 | return String.format("%02d:%02d", m_hour, m_minute); 193 | } 194 | 195 | public String toLongTimeString() 196 | { 197 | return String.format("%s.%03d", toString(), m_millisecond); 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/image/AbstractImage.java: -------------------------------------------------------------------------------- 1 | package org.csystem.util.image; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | import java.io.RandomAccessFile; 6 | 7 | public abstract class AbstractImage implements IIMage, Closeable { 8 | protected RandomAccessFile imageRaf; 9 | 10 | protected AbstractImage(String path) throws IOException 11 | { 12 | imageRaf = new RandomAccessFile(path, "r"); 13 | } 14 | //... 15 | 16 | public void close() throws IOException 17 | { 18 | imageRaf.close(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/image/IIMage.java: -------------------------------------------------------------------------------- 1 | package org.csystem.util.image; 2 | 3 | public interface IIMage { 4 | int getWidth() throws Exception; 5 | int getHeight() throws Exception; 6 | //... 7 | } 8 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/image/bitmap/DIBWindows.java: -------------------------------------------------------------------------------- 1 | package org.csystem.util.image.bitmap; 2 | 3 | import org.csystem.util.image.AbstractImage; 4 | import org.csystem.util.image.IIMage; 5 | 6 | import java.io.Closeable; 7 | import java.io.IOException; 8 | import java.nio.ByteBuffer; 9 | import java.nio.ByteOrder; 10 | 11 | public class DIBWindows extends AbstractImage implements IIMage, Closeable { 12 | private static final long WIDTH_OFFSET = 18; 13 | private static final long HEIGHT_OFFSET = 22; 14 | 15 | public DIBWindows(String path) throws IOException 16 | { 17 | super(path); 18 | } 19 | 20 | public int getHeight() throws IOException 21 | { 22 | imageRaf.seek(HEIGHT_OFFSET); 23 | byte [] data = new byte[Integer.BYTES]; 24 | 25 | imageRaf.read(data); 26 | //... 27 | 28 | return ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getInt(); 29 | } 30 | 31 | public int getWidth() throws IOException 32 | { 33 | imageRaf.seek(WIDTH_OFFSET); 34 | byte [] data = new byte[Integer.BYTES]; 35 | 36 | imageRaf.read(data); 37 | //... 38 | 39 | return ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getInt(); 40 | } 41 | //... 42 | } 43 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/io/file/FileUtil.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : FileUtil.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 08.01.2022 5 | 6 | Utility class that is used for file operations 7 | 8 | Copyleft (c) 1993 by C and System Programmers Association (CSD) 9 | All Rights Free 10 | -----------------------------------------------------------------------*/ 11 | package org.csystem.util.io.file; 12 | 13 | import java.io.File; 14 | import java.io.FileInputStream; 15 | import java.io.IOException; 16 | 17 | public final class FileUtil { 18 | private FileUtil() 19 | { 20 | } 21 | 22 | public static boolean areSame(String path1, String path2) throws IOException 23 | { 24 | File file1 = new File(path1); 25 | File file2 = new File(path2); 26 | 27 | if (file1.length() != file2.length()) 28 | return false; 29 | 30 | try (FileInputStream fis1 = new FileInputStream(file1); FileInputStream fis2 = new FileInputStream(file2)) { 31 | int b1; 32 | while ((b1 = fis1.read()) != -1) { 33 | int b2 = fis2.read(); 34 | 35 | if (b1 != b2) 36 | return false; 37 | } 38 | } 39 | 40 | return true; 41 | } 42 | 43 | //... 44 | } 45 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/Complex.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Complex.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 14.11.2021 5 | 6 | Immutable Complex class that can be used for Complex numbers 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.abs; 14 | import static java.lang.Math.sqrt; 15 | 16 | 17 | public class Complex { 18 | private static Complex add(double real1, double imag1, double real2, double imag2) 19 | { 20 | return new Complex(real1 + real2, imag1 + imag2); 21 | } 22 | 23 | private static Complex subtract(double real1, double imag1, double real2, double imag2) 24 | { 25 | return add(real1, imag1, -real2, -imag2); 26 | } 27 | 28 | private final double m_real; 29 | private final double m_imag; 30 | 31 | public Complex() 32 | { 33 | this(0); 34 | } 35 | 36 | public Complex(Complex other) 37 | { 38 | this(other.m_real, other.m_imag); 39 | } 40 | 41 | public Complex(double re) 42 | { 43 | this(re, 0); 44 | } 45 | 46 | public Complex(double re, double im) 47 | { 48 | m_real = re; 49 | m_imag = im; 50 | } 51 | 52 | public double getReal() 53 | { 54 | return m_real; 55 | } 56 | 57 | public double getImag() 58 | { 59 | return m_imag; 60 | } 61 | 62 | public double getLength() 63 | { 64 | return this.getNorm(); 65 | } 66 | 67 | public double getNorm() 68 | { 69 | return sqrt(m_real * m_real + m_imag * m_imag); 70 | } 71 | 72 | public Complex getConjugate() 73 | { 74 | return new Complex(m_real, -m_imag); 75 | } 76 | 77 | //add 78 | public static Complex add(double val, Complex right) 79 | { 80 | return add(val, 0, right.m_real, right.m_imag); 81 | } 82 | 83 | public Complex add(Complex right) 84 | { 85 | return add(m_real, m_imag, right.m_real, right.m_imag); 86 | } 87 | 88 | public Complex add(double val) 89 | { 90 | return add(m_real, m_imag, val, 0); 91 | } 92 | 93 | //subtract 94 | public static Complex subtract(double val, Complex right) 95 | { 96 | return subtract(val, 0, right.m_real, right.m_imag); 97 | } 98 | 99 | public Complex subtract(Complex right) 100 | { 101 | return subtract(m_real, m_imag, right.m_real, right.m_imag); 102 | } 103 | 104 | public Complex subtract(double val) 105 | { 106 | return subtract(m_real, m_imag, val, 0); 107 | } 108 | 109 | //inc 110 | public Complex inc() 111 | { 112 | return this.add(1); 113 | } 114 | 115 | //dec 116 | public Complex dec() 117 | { 118 | return this.inc(); 119 | } 120 | 121 | public String toString() 122 | { 123 | return String.format("|%.1f%si| = %f", m_real, (m_imag < 0 ? " - " : " + ") + abs(m_imag), this.getNorm()); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/Fraction.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Fraction.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 05.12.2021 5 | 6 | Fraction class that represents a fraction 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 int m_a; 15 | private int m_b; 16 | 17 | private static Fraction add(int a1, int b1, int a2, int b2) 18 | { 19 | return new Fraction(a1 * b2 + a2 * b1, b1 * b2); 20 | } 21 | 22 | private static Fraction subtract(int a1, int b1, int a2, int b2) 23 | { 24 | return add(a1, b1, -a2, b2); 25 | } 26 | 27 | private static Fraction multiply(int a1, int b1, int a2, int b2) 28 | { 29 | return new Fraction(a1 * a2, b1 * b2); 30 | } 31 | 32 | private static Fraction divide(int a1, int b1, int a2, int b2) 33 | { 34 | return multiply(a1, b1, b2, a2); 35 | } 36 | 37 | private static void check(int a, int b) 38 | { 39 | if (b == 0) { 40 | if (a == 0) 41 | throw new OperationStatusException("Indeterminate", OperationStatus.INDETERMINATE); 42 | 43 | throw new OperationStatusException("Undefined", OperationStatus.UNDEFINED); 44 | } 45 | } 46 | 47 | private void simplify() 48 | { 49 | int min = Math.min(Math.abs(m_a), m_b); 50 | 51 | for (int i = min; i >= 2; --i) 52 | if (m_a % i == 0 && m_b % i == 0) { 53 | m_a /= i; 54 | m_b /= i; 55 | break; 56 | } 57 | } 58 | 59 | private void setSign() 60 | { 61 | if (m_b < 0) { 62 | m_a = -m_a; 63 | m_b = -m_b; 64 | } 65 | } 66 | 67 | private void set(int a, int b) 68 | { 69 | if (a == 0) { 70 | m_a = 0; 71 | m_b = 1; 72 | return; 73 | } 74 | 75 | m_a = a; 76 | m_b = b; 77 | this.setSign(); 78 | this.simplify(); 79 | } 80 | 81 | public Fraction() 82 | { 83 | m_b = 1; 84 | } 85 | 86 | public Fraction(int a) 87 | { 88 | m_a = a; 89 | m_b = 1; 90 | } 91 | 92 | public Fraction(int a, int b) 93 | { 94 | check(a, b); 95 | this.set(a, b); 96 | } 97 | 98 | public int getNumerator() 99 | { 100 | return m_a; 101 | } 102 | 103 | public void setNumerator(int val) 104 | { 105 | if (m_a == val) 106 | return; 107 | 108 | this.set(val, m_b); 109 | } 110 | 111 | public int getDenominator() 112 | { 113 | return m_b; 114 | } 115 | 116 | public void setDenominator(int val) 117 | { 118 | if (m_b == val) 119 | return; 120 | 121 | check(m_a, val); 122 | this.set(m_a, val); 123 | } 124 | 125 | public double getRealValue() 126 | { 127 | return (double)m_a / m_b; 128 | } 129 | 130 | //add methods 131 | public static Fraction add(int val, Fraction f) 132 | { 133 | return add(val, 1, f.m_a, f.m_b); 134 | } 135 | 136 | public Fraction add(Fraction other) 137 | { 138 | return add(m_a, m_b, other.m_a, other.m_b); 139 | } 140 | 141 | public Fraction add(int val) 142 | { 143 | return add(m_a, m_b, val, 1); 144 | } 145 | 146 | //subtract methods 147 | public static Fraction subtract(int val, Fraction f) 148 | { 149 | return subtract(val, 1, f.m_a, f.m_b); 150 | } 151 | 152 | public Fraction subtract(Fraction other) 153 | { 154 | return subtract(m_a, m_b, other.m_a, other.m_b); 155 | } 156 | 157 | public Fraction subtract(int val) 158 | { 159 | return subtract(m_a, m_b, val, 1); 160 | } 161 | 162 | //multiply methods 163 | public static Fraction multiply(int val, Fraction f) 164 | { 165 | return multiply(val, 1, f.m_a, f.m_b); 166 | } 167 | 168 | public Fraction multiply(Fraction other) 169 | { 170 | return multiply(m_a, m_b, other.m_a, other.m_b); 171 | } 172 | 173 | public Fraction multiply(int val) 174 | { 175 | return multiply(m_a, m_b, val, 1); 176 | } 177 | 178 | //divide methods 179 | public static Fraction divide(int val, Fraction f) 180 | { 181 | return divide(val, 1, f.m_a, f.m_b); 182 | } 183 | 184 | public Fraction divide(Fraction other) 185 | { 186 | return divide(m_a, m_b, other.m_a, other.m_b); 187 | } 188 | 189 | public Fraction divide(int val) 190 | { 191 | return divide(m_a, m_b, val, 1); 192 | } 193 | 194 | //increment methods 195 | public void inc(int val) 196 | { 197 | m_a += m_b * val; 198 | } 199 | 200 | public void inc() 201 | { 202 | this.inc(1); 203 | } 204 | 205 | //decrement methods 206 | public void dec(int val) 207 | { 208 | inc(-val); 209 | } 210 | 211 | public void dec() 212 | { 213 | dec(1); 214 | } 215 | 216 | public String toString() 217 | { 218 | return this.toString(6); 219 | } 220 | 221 | public String toString(int n) 222 | { 223 | return String.format(String.format("%%d / %%d = %%.%df", n), m_a, m_b, this.getRealValue()); 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/OperationStatus.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : OperationStatus.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 05.12.2021 5 | 6 | Enum class that is used for operation status 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 enum OperationStatus { 14 | SUCCESS, UNDEFINED, INDETERMINATE 15 | } 16 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/OperationStatusException.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : OperationStatusException.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 05.12.2021 5 | 6 | Class for operation exceptions 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 OperationStatusException extends RuntimeException { 14 | private final OperationStatus m_operationStatus; 15 | 16 | public OperationStatusException(String message, OperationStatus operationStatus) 17 | { 18 | super(message); 19 | m_operationStatus = operationStatus; 20 | } 21 | 22 | public String getMessage() 23 | { 24 | return String.format("Message:%s, Operation Status:%s", super.getMessage(), m_operationStatus); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/geometry/AnalyticalCircle.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : AnalyticalCircle.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 06.11.2021 5 | 6 | AnalyticalCircle class that represents the analytical circle in geometry 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 Point m_center; 15 | 16 | public AnalyticalCircle() 17 | { 18 | this(0); 19 | } 20 | 21 | public AnalyticalCircle(double x, double y) 22 | { 23 | this(0, x, y); 24 | } 25 | 26 | public AnalyticalCircle(double r) 27 | { 28 | this(r, 0, 0); 29 | } 30 | 31 | public AnalyticalCircle(Point center) 32 | { 33 | this(0, center); 34 | } 35 | 36 | public AnalyticalCircle(double r, Point center) 37 | { 38 | this(r, center.x, center.y); 39 | } 40 | 41 | public AnalyticalCircle(double r, double x, double y) 42 | { 43 | super(r); 44 | m_center = Point.createCartesian(x, y); 45 | } 46 | 47 | public double getX() 48 | { 49 | return m_center.x; 50 | } 51 | 52 | public void setX(double x) 53 | { 54 | m_center.x = x; 55 | } 56 | 57 | public double getY() 58 | { 59 | return m_center.y; 60 | } 61 | 62 | public void setY(double y) 63 | { 64 | m_center.y = y; 65 | } 66 | 67 | public Point getCenter() 68 | { 69 | return new Point(m_center); 70 | } 71 | 72 | public void setCenter(Point center) 73 | { 74 | setCenter(center.x, center.y); 75 | } 76 | 77 | public void setCenter(double x, double y) 78 | { 79 | setX(x); 80 | setY(y); 81 | } 82 | 83 | public void offset(double dx, double dy) //delegate method 84 | { 85 | m_center.offset(dx, dy); 86 | } 87 | 88 | public void offset(double dxy) //delegate method 89 | { 90 | offset(dxy, dxy); 91 | } 92 | 93 | public double centerDistance(AnalyticalCircle other) 94 | { 95 | return m_center.distance(other.m_center); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/geometry/Circle.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Circle.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 09.10.2021 5 | 6 | Circle class that represents the circle in geometry 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.PI; 14 | import static java.lang.Math.abs; 15 | 16 | public class Circle { 17 | private double m_r; 18 | 19 | public Circle() 20 | {} 21 | 22 | public Circle(double r) 23 | { 24 | setRadius(r); 25 | } 26 | 27 | public double getRadius() 28 | { 29 | return m_r; 30 | } 31 | 32 | public void setRadius(double r) 33 | { 34 | m_r = abs(r); 35 | } 36 | 37 | public double getArea() 38 | { 39 | return PI * m_r * m_r; 40 | } 41 | 42 | public double getCircumference() 43 | { 44 | return 2 * PI * m_r; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/math/geometry/Point.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Point.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 14.11.2021 5 | 6 | Point class that represents the 2(two) dimensional point 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.sqrt; 14 | 15 | enum CoordinateType {CARTESIAN, POLAR} 16 | 17 | public class Point { 18 | public double x; 19 | public double y; 20 | 21 | private Point(double x, double y, CoordinateType coordinateType) 22 | { 23 | this.x = coordinateType == CoordinateType.CARTESIAN ? x : x * Math.cos(y); 24 | this.y = coordinateType == CoordinateType.CARTESIAN ? y : y * Math.sin(y); 25 | } 26 | 27 | Point(Point p) 28 | { 29 | x = p.x; 30 | y = p.y; 31 | } 32 | 33 | public static Point createCartesian(double x, double y) 34 | { 35 | return new Point(x, y, CoordinateType.CARTESIAN); 36 | } 37 | 38 | public static Point createPolar(double r, double theta) 39 | { 40 | return new Point(r, theta, CoordinateType.POLAR); 41 | } 42 | 43 | public double distance() 44 | { 45 | return this.distance(0, 0); 46 | } 47 | 48 | public double distance(Point other) 49 | { 50 | return this.distance(other.x, other.y); 51 | } 52 | 53 | public double distance(double x, double y) 54 | { 55 | return sqrt((this.x - x) * (this.x - x) + (this.y - y) * (this.y - y)); 56 | } 57 | 58 | public void offset(double dxy) 59 | { 60 | this.offset(dxy, dxy); 61 | } 62 | 63 | public void offset(double dx, double dy) 64 | { 65 | x += dx; 66 | y += dy; 67 | } 68 | 69 | public String toString() 70 | { 71 | return String.format("{x: %f, y: %f}", x, y); 72 | } 73 | 74 | //... 75 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/number/NumberUtil.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : NumberUtil.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 21.11.2021 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.number; 12 | 13 | import static java.lang.Math.*; 14 | 15 | public final class NumberUtil { 16 | private static final String [] ms_ones; 17 | private static final String [] ms_tens; 18 | 19 | static { 20 | ms_ones = new String[]{"", "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz"}; 21 | ms_tens = new String[]{"", "on", "yirmi", "otuz", "kırk", "elli", "altmış", "yetmiş", "seksen", "doksan"}; 22 | } 23 | 24 | private static int [] getDigits(long val, int n) 25 | { 26 | val = Math.abs(val); 27 | int [] result = new int[val == 0 ? 1 : (int)(Math.log10(val) / n) + 1]; 28 | 29 | for (int i = result.length - 1; val != 0; result[i--] = (int)(val % (long)Math.pow(10, n)), val /= Math.pow(10, n)) 30 | ; 31 | 32 | return result; 33 | } 34 | 35 | private static String numberToText3DigitsTR(int val) 36 | { 37 | if (val == 0) 38 | return "sıfır"; 39 | 40 | String text = val < 0 ? "eksi" : ""; 41 | 42 | val = Math.abs(val); 43 | 44 | int a = val / 100; 45 | int b = val % 100 / 10; 46 | int c = val % 10; 47 | 48 | if (a != 0) { 49 | if (a != 1) 50 | text += ms_ones[a]; 51 | text += "yüz"; 52 | } 53 | 54 | if (b != 0) 55 | text += ms_tens[b]; 56 | 57 | if (c != 0) 58 | text += ms_ones[c]; 59 | 60 | return text; 61 | } 62 | 63 | private NumberUtil() 64 | { 65 | } 66 | 67 | public static int calculateDigitalRoot(int val) 68 | { 69 | int root = abs(val); 70 | 71 | while ((root = digitsSum(root)) > 9) 72 | ; 73 | 74 | return root; 75 | } 76 | 77 | public static int countDigits(long val) 78 | { 79 | return val == 0 ? 1 : (int)log10(abs(val)) + 1; 80 | } 81 | 82 | public static int digitsSum(long val) 83 | { 84 | int sum = 0; 85 | 86 | while (val != 0) { 87 | sum += val % 10; 88 | val /= 10; 89 | } 90 | 91 | return sum; 92 | } 93 | 94 | public static void displayCollatz(int n) 95 | { 96 | if (n <= 0) { 97 | System.out.println("Geçersiz Sayı"); 98 | return; 99 | } 100 | 101 | System.out.println(n); 102 | 103 | while (n != 1) 104 | System.out.println(n = n % 2 == 0 ? n / 2 : 3 * n + 1); 105 | } 106 | 107 | public static int factorial(int n) 108 | { 109 | int result = 1; 110 | 111 | for (int i = 2; i <= n; ++i) 112 | result *= i; 113 | 114 | return result; 115 | } 116 | 117 | public static int gcd(int a, int b) 118 | { 119 | int min = min(abs(a), abs(b)); 120 | 121 | for (int i = min; i >= 2; --i) 122 | if (a % i == 0 && b % i == 0) 123 | return i; 124 | 125 | return 1; 126 | } 127 | 128 | public static int [] getDigits(long val) 129 | { 130 | return getDigits(val, 1); 131 | } 132 | 133 | public static int [] getDigitsInTwos(long val) 134 | { 135 | return getDigits(val, 2); 136 | } 137 | 138 | public static int [] getDigitsInThrees(long val) 139 | { 140 | return getDigits(val, 3); 141 | } 142 | 143 | public static int getDigitsPowSum(int val) 144 | { 145 | int n = countDigits(val); 146 | int sum = 0; 147 | 148 | while (val != 0) { 149 | sum += pow(val % 10, n); 150 | val /= 10; 151 | } 152 | 153 | return sum; 154 | } 155 | 156 | public static int getDigitsFactorialSum(int n) 157 | { 158 | int sum = 0; 159 | 160 | while (n != 0) { 161 | sum += factorial(n % 10); 162 | n /= 10; 163 | } 164 | 165 | return sum; 166 | } 167 | 168 | public static int getIndexOfPrime(int n) 169 | { 170 | int i = 1; 171 | int val = 2; 172 | 173 | for (;;) { 174 | if (val == n) 175 | return i; 176 | 177 | if (isPrime(val)) 178 | ++i; 179 | 180 | ++val; 181 | } 182 | } 183 | 184 | public static int getNextFibonacciNumber(int val) 185 | { 186 | if (val < 0) 187 | return 0; 188 | 189 | int prev1 = 1, prev2 = 0, result; 190 | 191 | for (;;) { 192 | result = prev1 + prev2; 193 | 194 | if (result > val) 195 | return result; 196 | 197 | prev2 = prev1; 198 | prev1 = result; 199 | } 200 | } 201 | 202 | public static int getPrime(int n) 203 | { 204 | int count = 0; 205 | int val = 2; 206 | 207 | for (;;) { 208 | if (isPrime(val)) 209 | ++count; 210 | 211 | if (count == n) 212 | return val; 213 | 214 | ++val; 215 | } 216 | } 217 | 218 | public static int mid(int a, int b, int c) 219 | { 220 | if (a <= b && b <= c || c <= b && b <= a) 221 | return b; 222 | 223 | if (b <= a && a <= c || c <= a && a <= b) 224 | return a; 225 | 226 | return c; 227 | } 228 | 229 | public static String numberToText(int val) 230 | { 231 | //TODO: 232 | return numberToText3DigitsTR(val); 233 | } 234 | 235 | 236 | public static void printGoldbachPrimes(int val) 237 | { 238 | for (int a = 2; a < val; ++a) { 239 | int b = val - a; 240 | 241 | if (isPrime(a) && isPrime(b) && a <= b) 242 | System.out.printf("%d + %d = %d == %d%n", a, b, a + b, val); 243 | } 244 | } 245 | 246 | public static void printPrimeFactors(int n) 247 | { 248 | if (n == 0) 249 | return; 250 | 251 | n = abs(n); 252 | 253 | int i = 2; 254 | 255 | while (n != 1) { 256 | if (n % i == 0) { 257 | System.out.printf("%d ", i); 258 | n /= i; 259 | } 260 | else 261 | ++i; 262 | } 263 | 264 | System.out.println(); 265 | } 266 | 267 | public static int reversed(int val) 268 | { 269 | int result = 0; 270 | 271 | while (val != 0) { 272 | result = result * 10 + val % 10; 273 | val /= 10; 274 | } 275 | 276 | return result; 277 | } 278 | 279 | 280 | public static int sumFactors(int val) 281 | { 282 | if (val == 1) 283 | return 1; 284 | 285 | int result = 0; 286 | int sqrtVal = (int)sqrt(val); 287 | 288 | for (int i = 2; i <= sqrtVal; ++i) 289 | if (val % i == 0) 290 | result += (i == val / i) ? i : (i + val / i); 291 | 292 | return result + 1; 293 | } 294 | 295 | public static boolean areFriends(int a, int b) 296 | { 297 | return sumFactors(a) == b && sumFactors(b) == a; 298 | } 299 | 300 | public static boolean isArmstrong(int val) 301 | { 302 | return val >= 0 && getDigitsPowSum(val) == val; 303 | } 304 | 305 | public static boolean isFactorian(int n) 306 | { 307 | return n >= 0 && getDigitsFactorialSum(n) == n; 308 | } 309 | 310 | public static boolean isDecimalHarshad(int val) 311 | { 312 | return val > 0 && val % digitsSum(val) == 0; 313 | } 314 | 315 | public static boolean isHardyRamanujan(int val) 316 | { 317 | if (val <= 0) 318 | return false; 319 | 320 | int count = 0; 321 | 322 | EXIT_LOOP: 323 | for (int x = 1; x * x * x < val; ++x) 324 | for (int y = x + 1; x * x * x + y * y * y <= val; ++y) 325 | if (x * x * x + y * y * y == val) { 326 | if (++count == 2) 327 | break EXIT_LOOP; 328 | ++x; 329 | } 330 | return count == 2; 331 | } 332 | 333 | public static boolean isPerfect(int val) 334 | { 335 | return sumFactors(val) == val; 336 | } 337 | 338 | public static boolean isPrime(long val) 339 | { 340 | if (val <= 1) 341 | return false; 342 | 343 | if (val % 2 == 0) 344 | return val == 2; 345 | 346 | if (val % 3 == 0) 347 | return val == 3; 348 | 349 | if (val % 5 == 0) 350 | return val == 5; 351 | 352 | if (val % 7 == 0) 353 | return val == 7; 354 | 355 | int sqrtVal = (int)sqrt(val); 356 | 357 | for (long i = 11; i <= sqrtVal; i += 2) 358 | if (val % i == 0) 359 | return false; 360 | 361 | 362 | return true; 363 | } 364 | 365 | public static boolean isPrimeX(long val) 366 | { 367 | boolean result; 368 | 369 | for (long sum = val; (result = isPrime(sum)) && sum > 9; sum = digitsSum(sum)) 370 | ; 371 | 372 | return result; 373 | } 374 | 375 | public static boolean isSuperPrime(int n) 376 | { 377 | return isPrime(n) && isPrime(getIndexOfPrime(n)); 378 | } 379 | } -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/system/SystemUtil.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : SystemUtil.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 02.01.2022 5 | 6 | Utility class for system operations 7 | 8 | Copyleft (c) 1993 by C and System Programmers Association (CSD) 9 | All Rights Free 10 | -----------------------------------------------------------------------*/ 11 | package org.csystem.util.system; 12 | 13 | import java.nio.ByteBuffer; 14 | import java.nio.ByteOrder; 15 | 16 | public final class SystemUtil { 17 | private SystemUtil() 18 | { 19 | } 20 | 21 | public static ByteOrder getEndian(ByteBuffer byteBuffer) 22 | { 23 | return byteBuffer.order(); 24 | } 25 | 26 | public static void toLittleEndian(ByteBuffer byteBuffer) 27 | { 28 | byteBuffer.order(ByteOrder.LITTLE_ENDIAN); 29 | } 30 | 31 | public static String getEndianText() 32 | { 33 | return ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? "Little Endian" : "Big Endian"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/tuple/Pair.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Pair.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 21.01.2022 5 | 6 | Immutable Pair class that represents 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 final 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 | m_first = null; 25 | m_second = null; 26 | } 27 | 28 | public Pair(F first, S second) 29 | { 30 | m_first = first; 31 | m_second = second; 32 | } 33 | 34 | public F getFirst() 35 | { 36 | return m_first; 37 | } 38 | 39 | public S getSecond() 40 | { 41 | return m_second; 42 | } 43 | 44 | public String toString() 45 | { 46 | return String.format("(%s, %s)", m_first, m_second); 47 | } 48 | 49 | //... 50 | } 51 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/tuple/Triple.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Triple.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 21.01.2022 5 | 6 | Immutable Value class that represents 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 final 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 | m_first = null; 26 | m_second = null; 27 | m_third = null; 28 | } 29 | 30 | public Triple(F first, S second, T third) 31 | { 32 | m_first = first; 33 | m_second = second; 34 | m_third = third; 35 | } 36 | 37 | public F getFirst() 38 | { 39 | return m_first; 40 | } 41 | 42 | public S getSecond() 43 | { 44 | return m_second; 45 | } 46 | 47 | public T getThird() 48 | { 49 | return m_third; 50 | } 51 | 52 | public String toString() 53 | { 54 | return String.format("(%s, %s, %s)", m_first, m_second, m_third); 55 | } 56 | 57 | //... 58 | } 59 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/tuple/Value.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : Value.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 21.01.2022 5 | 6 | Immutable Value class that represents 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 final class Value { 14 | private final T m_value; 15 | 16 | public static Value of(T val) 17 | { 18 | return new Value<>(val); 19 | } 20 | 21 | public Value() 22 | { 23 | m_value = 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 m_value + ""; 39 | } 40 | 41 | //... 42 | } 43 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/wrapper/IntValue.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : IntValue.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 14.11.2021 5 | 6 | Immutable IntValue class for wrapping an int value by using cache 7 | for [-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[] ms_cache = new IntValue[CACHE_MAX - CACHE_MIN + 1]; 18 | private final int m_value; 19 | 20 | private IntValue(int value) 21 | { 22 | m_value = value; 23 | } 24 | 25 | public static final IntValue ZERO = of(0); 26 | public static final IntValue ONE = of(1); 27 | public static final IntValue TEN = of(10); 28 | 29 | public static IntValue of(int value) 30 | { 31 | if (value < CACHE_MIN || CACHE_MAX < value) 32 | return new IntValue(value); 33 | 34 | int idx = value + 128; 35 | 36 | if (ms_cache[idx] == null) 37 | ms_cache[idx] = new IntValue(value); 38 | 39 | return ms_cache[idx]; 40 | } 41 | 42 | public int getValue() 43 | { 44 | return m_value; 45 | } 46 | 47 | public int compareTo(IntValue other) 48 | { 49 | return m_value - other.m_value; 50 | } 51 | 52 | public IntValue add(int value) 53 | { 54 | return of(m_value + value); 55 | } 56 | 57 | public IntValue add(IntValue other) 58 | { 59 | return add(other.m_value); 60 | } 61 | 62 | public IntValue subtract(int value) 63 | { 64 | return add(-value); 65 | } 66 | 67 | public IntValue subtract(IntValue other) 68 | { 69 | return subtract(other.m_value); 70 | } 71 | 72 | public IntValue multiply(int value) 73 | { 74 | return of(m_value * value); 75 | } 76 | 77 | public IntValue multiply(IntValue other) 78 | { 79 | return multiply(other.m_value); 80 | } 81 | 82 | public IntValue divide(int value) 83 | { 84 | return of(m_value / value); 85 | } 86 | 87 | public IntValue divide(IntValue other) 88 | { 89 | return divide(other.m_value); 90 | } 91 | 92 | public IntValue [] divideWithRemainder(int value) 93 | { 94 | IntValue [] result = new IntValue[2]; 95 | result[0] = divide(value); 96 | result[1] = of(m_value % value); 97 | 98 | return result; 99 | } 100 | 101 | public IntValue [] divideWithRemainder(IntValue other) 102 | { 103 | return divideWithRemainder(other.m_value); 104 | } 105 | 106 | public IntValue increment() 107 | { 108 | return add(1); 109 | } 110 | 111 | public IntValue decrement() 112 | { 113 | return subtract(1); 114 | } 115 | 116 | public String toString() 117 | { 118 | return m_value + ""; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/Sample/src/org/csystem/util/wrapper/MutableIntValue.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------- 2 | FILE : MutableIntValue.java 3 | AUTHOR : Java-May-2021 Group 4 | LAST UPDATE : 14.11.2021 5 | 6 | MutableIntValue class for wrapping 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 class MutableIntValue { 14 | private int m_val; 15 | 16 | public MutableIntValue() 17 | {} 18 | 19 | public MutableIntValue(int val) 20 | { 21 | m_val = val; 22 | } 23 | 24 | public int getVal() 25 | { 26 | return m_val; 27 | } 28 | 29 | public MutableIntValue setVal(int val) 30 | { 31 | m_val = val; 32 | 33 | return this; 34 | } 35 | 36 | public MutableIntValue add(int val) 37 | { 38 | m_val += val; 39 | 40 | return this; 41 | } 42 | 43 | public MutableIntValue subtract(int val) 44 | { 45 | add(-val); 46 | 47 | return this; 48 | } 49 | 50 | public MutableIntValue multiply(int val) 51 | { 52 | m_val *= val; 53 | 54 | return this; 55 | } 56 | 57 | public MutableIntValue divide(int val) 58 | { 59 | m_val /= val; 60 | 61 | return this; 62 | } 63 | 64 | public String toString() 65 | { 66 | return m_val + ""; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/src-console/csd/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/src-console/csd/App.class -------------------------------------------------------------------------------- /src/src-console/csd/App.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package csd; 5 | 6 | class App { 7 | public static void main(String [] args) 8 | { 9 | System.out.println("Merhaba ben App.main"); 10 | msd.Sample.main(args); 11 | } 12 | } 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/src-console/msd/Mample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/src-console/msd/Mample.class -------------------------------------------------------------------------------- /src/src-console/msd/Mample.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package msd; 5 | 6 | public class Mample { 7 | 8 | } -------------------------------------------------------------------------------- /src/src-console/msd/Sample.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oguzkaran/Java-Nov-2020/bd36f106b3a734d4b3f7752ac319424af15383e7/src/src-console/msd/Sample.class -------------------------------------------------------------------------------- /src/src-console/msd/Sample.java: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------------------------------------------------- 2 | 3 | ----------------------------------------------------------------------------------------------------------------------*/ 4 | package msd.util; 5 | 6 | public class Sample { 7 | public static void main(String [] args) 8 | { 9 | System.out.println("Merhaba ben Sample.main"); 10 | } 11 | } --------------------------------------------------------------------------------