Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev nc packages #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/main/java/BookRandomizer.java

This file was deleted.

36 changes: 0 additions & 36 deletions src/main/java/CarRandomizer.java

This file was deleted.

28 changes: 8 additions & 20 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
import java.util.Arrays;
import java.util.Scanner;
import menu.*;

public class Main {
public static enum datatype{
CAR,
BOOK,
ROOTVEGETABLE
}
public static void main(String[] args) {
//Storage storage = Storage.getInstance();

Menu print_array_menu=new Menu();
print_array_menu.prelude="Выберите тип данных";
print_array_menu.addAction("1", "Автомобиль",new PrintArrayAction<Car>(datatype.CAR));
print_array_menu.addAction("2", "Книга",new PrintArrayAction<Book>(datatype.BOOK));
print_array_menu.addAction("3", "Корнепллод",new PrintArrayAction<RootVegetable>(datatype.ROOTVEGETABLE));
print_array_menu.addAction("0", "Отмена", null);

Menu menu = new Menu();
menu.reopen_after_submenu_closes=true;
menu.addAction("1", "Заполнение массива объектов вручную", new ManuallyFillArrayAction());
menu.addAction("2", "Создание массива объектов с рандомными значениями", new RandomFillArrayAction());
menu.addAction("3", "Вывод массива объектов на экран", print_array_menu);
menu.addAction("4", "Сортировка массива", null);//TODO
menu.addAction("5", "Выход", null);
menu.addAction("1", "Заполнение массива объектов из файла", new ReadFileArrayAction());
menu.addAction("2", "Заполнение массива объектов вручную", new ManuallyFillArrayAction());
menu.addAction("3", "Заполнение массива объектов рандомными значениями", new RandomFillArrayAction());
menu.addAction("4", "Вывод массива объектов на экран", new PrintType());
menu.addAction("5", "Сортировка", new SortAction());
menu.addAction("7", "Поиск элемента в массиве",new SearchHelper());
menu.addAction("0", "Выход", new ExitAction());

menu.execute();
}
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/ManuallyFillArrayAction.java

This file was deleted.

93 changes: 0 additions & 93 deletions src/main/java/Menu.java

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/java/MenuAction.java

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/java/ParseBook.java

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/java/ParseCar.java

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/java/ParseRootVegetable.java

This file was deleted.

23 changes: 0 additions & 23 deletions src/main/java/PrintArrayAction.java

This file was deleted.

36 changes: 0 additions & 36 deletions src/main/java/RootVegetableRandomizer.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package menu;

public class ExitAction implements MenuAction{
@Override
public void execute() {
public MenuAction execute() {
System.out.println("Выход из программы...");
System.exit(0);

}
return null;
}
}
Loading