This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab4; | |
| import lab4.rbtree.RedBlackTreeMap; | |
| import java.util.List; | |
| import java.util.Random; | |
| import java.util.function.Consumer; | |
| /** | |
| * Тестовий клас для демонстрації функціональності червоно-чорного дерева | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab4.rbtree; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * Реалізація асоціативного масиву на основі червоно-чорного дерева | |
| * @param <K> тип ключа (повинен реалізовувати Comparable) | |
| * @param <V> тип значення | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.fileio; | |
| import lab3.tram.TramStop; | |
| import lab3.tram.Hour; | |
| import java.io.IOException; | |
| /** | |
| * Абстрактний клас для представлення трамвайної зупинки з можливостями файлового введення-виведення. | |
| * Розширює базовий клас TramStop додатковими операціями роботи з файлами різних форматів. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.fileio; | |
| import lab3.tram.Hour; | |
| import java.io.*; | |
| import java.util.*; | |
| /** | |
| * Клас для роботи з трамвайними зупинками через текстові файли. | |
| * Реалізує операції читання та запису даних у текстовому форматі. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.fileio; | |
| import lab3.tram.Hour; | |
| import java.io.*; | |
| /** | |
| * Клас для роботи з трамвайними зупинками через бінарні файли. | |
| * Реалізує операції читання та запису даних у бінарному форматі. | |
| */ | |
| public class TramStopWithBinaryFile extends TramStopWithFile { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5; | |
| import lab5.fileio.TramStopWithTextFile; | |
| import lab5.fileio.TramStopWithBinaryFile; | |
| import java.io.File; | |
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| /** | |
| * Демонстрація роботи з файлами для трамвайних зупинок. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.sorting; | |
| import java.util.Comparator; | |
| /** | |
| * Компаратор для сортування цілих чисел за збільшенням суми їх цифр. | |
| * Якщо суми цифр однакові, сортування здійснюється за значенням самого числа. | |
| */ | |
| public class DigitSumComparator implements Comparator<Integer> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.sorting; | |
| import java.util.Comparator; | |
| /** | |
| * Компаратор для сортування цілих чисел за зменшенням суми їх цифр. | |
| * Якщо суми цифр однакові, сортування здійснюється за значенням самого числа у зворотному порядку. | |
| */ | |
| public class DigitSumComparatorDescending implements Comparator<Integer> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5.sorting; | |
| import java.io.*; | |
| import java.util.*; | |
| /** | |
| * Клас для читання цілих чисел з файлу, сортування за сумою цифр та збереження результатів. | |
| */ | |
| public class IntegerSorter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lab5; | |
| import lab5.sorting.IntegerSorter; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| /** | |
| * Демонстрація сортування цілих чисел за сумою цифр. |