diff options
Diffstat (limited to 'ui-console/src/main/java')
11 files changed, 107 insertions, 92 deletions
diff --git a/ui-console/src/main/java/market/guess/ui/console/Menu.java b/ui-console/src/main/java/market/guess/ui/console/Menu.java index 90ddd38..9041590 100644 --- a/ui-console/src/main/java/market/guess/ui/console/Menu.java +++ b/ui-console/src/main/java/market/guess/ui/console/Menu.java | |||
| @@ -20,8 +20,8 @@ public final class Menu implements Startable { | |||
| 20 | public void start() { | 20 | public void start() { |
| 21 | var max = commands.stream().mapToInt(MenuCommand::getIndex).max().orElse(0); | 21 | var max = commands.stream().mapToInt(MenuCommand::getIndex).max().orElse(0); |
| 22 | io.splashScreen(); | 22 | io.splashScreen(); |
| 23 | while (true) { | ||
| 24 | 23 | ||
| 24 | while (true) { | ||
| 25 | io.newLine(); | 25 | io.newLine(); |
| 26 | for (var command : commands) { | 26 | for (var command : commands) { |
| 27 | io.println(" [%d]->> %s".formatted(command.getIndex(), command.getName())); | 27 | io.println(" [%d]->> %s".formatted(command.getIndex(), command.getName())); |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/BuyMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/BuyMenuCommand.java index b8e2523..df40aa8 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/BuyMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/BuyMenuCommand.java | |||
| @@ -1,17 +1,19 @@ | |||
| 1 | package market.guess.ui.console.command; | 1 | package market.guess.ui.console.command; |
| 2 | 2 | ||
| 3 | import market.guess.api.CatalogContext; | ||
| 3 | import market.guess.api.EventStatus; | 4 | import market.guess.api.EventStatus; |
| 4 | import market.guess.api.GuessMarketContext; | 5 | import market.guess.api.GuessMarketContext; |
| 5 | import market.guess.exception.GuessMarketException; | ||
| 6 | import market.guess.ui.console.io.InputProcessor; | 6 | import market.guess.ui.console.io.InputProcessor; |
| 7 | 7 | ||
| 8 | public final class BuyMenuCommand implements MenuCommand { | 8 | public final class BuyMenuCommand implements MenuCommand { |
| 9 | private final GuessMarketContext context; | 9 | private final GuessMarketContext context; |
| 10 | private final CatalogContext catalog; | ||
| 10 | private final InputProcessor io; | 11 | private final InputProcessor io; |
| 11 | 12 | ||
| 12 | public BuyMenuCommand(GuessMarketContext context, InputProcessor io) { | 13 | public BuyMenuCommand(GuessMarketContext context, CatalogContext catalog, InputProcessor io) { |
| 13 | super(); | 14 | super(); |
| 14 | this.context = context; | 15 | this.context = context; |
| 16 | this.catalog = catalog; | ||
| 15 | this.io = io; | 17 | this.io = io; |
| 16 | } | 18 | } |
| 17 | 19 | ||
| @@ -26,49 +28,45 @@ public final class BuyMenuCommand implements MenuCommand { | |||
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | @Override | 30 | @Override |
| 29 | public boolean allowed() { | ||
| 30 | // TODO Auto-generated method stub | ||
| 31 | throw new UnsupportedOperationException("Unimplemented method 'allowed'"); | ||
| 32 | } | ||
| 33 | |||
| 34 | @Override | ||
| 35 | public void execute() { | 31 | public void execute() { |
| 36 | var active = | 32 | var result = catalog.getAllEvents(); |
| 37 | context.listEvents().stream() | 33 | |
| 38 | .filter(event -> event.status() == EventStatus.ACTIVE) | 34 | if (!result.isSuccess()) { |
| 39 | .toList(); | 35 | io.println("Failed to list events"); |
| 36 | return; | ||
| 37 | } | ||
| 38 | |||
| 39 | var events = result.getData(); | ||
| 40 | var active = events.stream().filter(event -> event.status() == EventStatus.ACTIVE).toList(); | ||
| 40 | 41 | ||
| 41 | if (active.isEmpty()) { | 42 | if (active.isEmpty()) { |
| 42 | io.println("There are currently no active events to trade on."); | 43 | io.println("There are currently no active events to trade on."); |
| 43 | return; | 44 | return; |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | var pick = | 47 | var pick = io.readSelect("Pick an event: ", active, event -> "%s".formatted(event.name())); |
| 47 | io.readSelect( | ||
| 48 | "Pick an event: ", | ||
| 49 | active, | ||
| 50 | event -> "[%d] %s".formatted(event.displayId(), event.name())); | ||
| 51 | |||
| 52 | var event = context.getEvent(pick.eventKey()); | ||
| 53 | 48 | ||
| 49 | var result2 = catalog.getEvent(pick.key()); | ||
| 50 | var event = result2.getData(); | ||
| 54 | if (event == null) { | 51 | if (event == null) { |
| 55 | io.println("That event is no longer available."); | 52 | io.println("That event is no longer available."); |
| 56 | return; | 53 | return; |
| 57 | } | 54 | } |
| 58 | 55 | ||
| 59 | // TODO: print state | 56 | io.printState(event.state()); |
| 60 | 57 | ||
| 61 | var option = | 58 | var market = |
| 62 | io.readSelect( | 59 | io.readSelect( |
| 63 | "Choose an option: ", event.state().options(), o -> "%s [value %d, %d shares helds]"); | 60 | "Choose a market: ", |
| 61 | event.state().markets(), | ||
| 62 | o -> "%s [value %d, %d shares helds]".formatted(o.name(), o.price(), o.volume())); | ||
| 64 | 63 | ||
| 65 | var amount = io.readInt("How many shares? ", 1, Integer.MAX_VALUE); | 64 | var amount = io.readInt("How many shares? ", 1, Integer.MAX_VALUE); |
| 66 | 65 | ||
| 67 | try { | 66 | var receipt = context.buyShares("", event.summary().key(), market.key(), amount); |
| 68 | var receipt = context.buyShares("", option.optionKey(), option.optionKey(), amount); | 67 | if (receipt.isSuccess()) return; |
| 69 | } catch (GuessMarketException e) { | 68 | |
| 70 | io.newLine(); | 69 | io.newLine(); |
| 71 | io.println("Purchase declined: %s".formatted(e.getMessage())); | 70 | io.println("Purchase declined: %s".formatted(receipt.getMessage())); |
| 72 | } | ||
| 73 | } | 71 | } |
| 74 | } | 72 | } |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/EventDetailsMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/EventDetailsMenuCommand.java index e12caeb..ab60a1f 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/EventDetailsMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/EventDetailsMenuCommand.java | |||
| @@ -13,12 +13,6 @@ public final class EventDetailsMenuCommand implements MenuCommand { | |||
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | @Override | 15 | @Override |
| 16 | public boolean allowed() { | ||
| 17 | // TODO Auto-generated method stub | ||
| 18 | throw new UnsupportedOperationException("Unimplemented method 'allowed'"); | ||
| 19 | } | ||
| 20 | |||
| 21 | @Override | ||
| 22 | public void execute() { | 16 | public void execute() { |
| 23 | // TODO Auto-generated method stub | 17 | // TODO Auto-generated method stub |
| 24 | throw new UnsupportedOperationException("Unimplemented method 'execute'"); | 18 | throw new UnsupportedOperationException("Unimplemented method 'execute'"); |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/ExitMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/ExitMenuCommand.java index 23ed9c9..4fcc448 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/ExitMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/ExitMenuCommand.java | |||
| @@ -21,11 +21,6 @@ public final class ExitMenuCommand implements MenuCommand { | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | @Override | 23 | @Override |
| 24 | public boolean allowed() { | ||
| 25 | return true; | ||
| 26 | } | ||
| 27 | |||
| 28 | @Override | ||
| 29 | public boolean isExit() { | 24 | public boolean isExit() { |
| 30 | return true; | 25 | return true; |
| 31 | } | 26 | } |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/ListEventsMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/ListEventsMenuCommand.java index bad621d..a97ab9f 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/ListEventsMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/ListEventsMenuCommand.java | |||
| @@ -1,16 +1,16 @@ | |||
| 1 | package market.guess.ui.console.command; | 1 | package market.guess.ui.console.command; |
| 2 | 2 | ||
| 3 | import market.guess.api.CatalogContext; | ||
| 3 | import market.guess.api.CommissionTiming; | 4 | import market.guess.api.CommissionTiming; |
| 4 | import market.guess.api.GuessMarketContext; | ||
| 5 | import market.guess.ui.console.io.InputProcessor; | 5 | import market.guess.ui.console.io.InputProcessor; |
| 6 | 6 | ||
| 7 | public final class ListEventsMenuCommand implements MenuCommand { | 7 | public final class ListEventsMenuCommand implements MenuCommand { |
| 8 | private final GuessMarketContext context; | 8 | private final CatalogContext catalog; |
| 9 | private final InputProcessor io; | 9 | private final InputProcessor io; |
| 10 | 10 | ||
| 11 | public ListEventsMenuCommand(GuessMarketContext context, InputProcessor io) { | 11 | public ListEventsMenuCommand(CatalogContext catalog, InputProcessor io) { |
| 12 | super(); | 12 | super(); |
| 13 | this.context = context; | 13 | this.catalog = catalog; |
| 14 | this.io = io; | 14 | this.io = io; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| @@ -25,13 +25,13 @@ public final class ListEventsMenuCommand implements MenuCommand { | |||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | public boolean allowed() { | ||
| 29 | return !context.listEvents().isEmpty(); | ||
| 30 | } | ||
| 31 | |||
| 32 | @Override | ||
| 33 | public void execute() { | 28 | public void execute() { |
| 34 | var events = context.listEvents(); | 29 | var result = catalog.getAllEvents(); |
| 30 | |||
| 31 | if (!result.isSuccess()) { | ||
| 32 | return; | ||
| 33 | } | ||
| 34 | var events = result.getData(); | ||
| 35 | 35 | ||
| 36 | for (var event : events) { | 36 | for (var event : events) { |
| 37 | io.newLine(); | 37 | io.newLine(); |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/LoadFileMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/LoadFileMenuCommand.java index 7005632..065ac6e 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/LoadFileMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/LoadFileMenuCommand.java | |||
| @@ -1,15 +1,15 @@ | |||
| 1 | package market.guess.ui.console.command; | 1 | package market.guess.ui.console.command; |
| 2 | 2 | ||
| 3 | import java.nio.file.Path; | 3 | import java.nio.file.Path; |
| 4 | import market.guess.api.GuessMarketContext; | 4 | import market.guess.api.CatalogContext; |
| 5 | import market.guess.ui.console.io.InputProcessor; | 5 | import market.guess.ui.console.io.InputProcessor; |
| 6 | 6 | ||
| 7 | public final class LoadFileMenuCommand implements MenuCommand { | 7 | public final class LoadFileMenuCommand implements MenuCommand { |
| 8 | private final GuessMarketContext context; | 8 | private final CatalogContext catalog; |
| 9 | private final InputProcessor io; | 9 | private final InputProcessor io; |
| 10 | 10 | ||
| 11 | public LoadFileMenuCommand(GuessMarketContext context, InputProcessor io) { | 11 | public LoadFileMenuCommand(CatalogContext catalog, InputProcessor io) { |
| 12 | this.context = context; | 12 | this.catalog = catalog; |
| 13 | this.io = io; | 13 | this.io = io; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| @@ -24,23 +24,24 @@ public final class LoadFileMenuCommand implements MenuCommand { | |||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | @Override | 26 | @Override |
| 27 | public boolean allowed() { | ||
| 28 | return true; | ||
| 29 | } | ||
| 30 | |||
| 31 | @Override | ||
| 32 | public void execute() { | 27 | public void execute() { |
| 33 | var path = io.readPath("Pleae enter the full file path to the XML file: "); | 28 | // var path = io.readPath("Pleae enter the full file path to the XML file: "); |
| 34 | var result = context.loadEvents(Path.of(path)); | 29 | // var result = context.loadEvents(Path.of(path)); |
| 30 | var result = | ||
| 31 | catalog.loadEvents( | ||
| 32 | Path.of("/home/hex-dev/projects/guess-market/test-data/ex-1/multiple.xml")); | ||
| 35 | 33 | ||
| 36 | if (result.success()) { | 34 | if (result.isSuccess()) { |
| 37 | io.println("Loaded %d event(s) from %s.".formatted(result.eventsLoaded(), result.source())); | 35 | io.println( |
| 36 | "Loaded %d event(s) from %s." | ||
| 37 | .formatted(result.getData().eventsLoaded(), result.getData().source())); | ||
| 38 | return; | 38 | return; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | io.println( | 41 | io.println( |
| 42 | "The file was not loaded. %d problem(s) were found: ".formatted(result.issues().size())); | 42 | "The file was not loaded. %d problem(s) were found: " |
| 43 | for (var issue : result.issues()) { | 43 | .formatted(result.getData().issues().size())); |
| 44 | for (var issue : result.getData().issues()) { | ||
| 44 | io.println(" - %s: %s".formatted(issue.location(), issue.humanizedMessage())); | 45 | io.println(" - %s: %s".formatted(issue.location(), issue.humanizedMessage())); |
| 45 | } | 46 | } |
| 46 | } | 47 | } |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/LoadMarketStateMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/LoadMarketStateMenuCommand.java index 3111044..defb402 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/LoadMarketStateMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/LoadMarketStateMenuCommand.java | |||
| @@ -1,6 +1,18 @@ | |||
| 1 | package market.guess.ui.console.command; | 1 | package market.guess.ui.console.command; |
| 2 | 2 | ||
| 3 | import java.nio.file.Path; | ||
| 4 | import market.guess.api.GuessMarketContext; | ||
| 5 | import market.guess.ui.console.io.InputProcessor; | ||
| 6 | |||
| 3 | public final class LoadMarketStateMenuCommand implements MenuCommand { | 7 | public final class LoadMarketStateMenuCommand implements MenuCommand { |
| 8 | private final GuessMarketContext context; | ||
| 9 | private final InputProcessor io; | ||
| 10 | |||
| 11 | public LoadMarketStateMenuCommand(GuessMarketContext context, InputProcessor io) { | ||
| 12 | super(); | ||
| 13 | this.context = context; | ||
| 14 | this.io = io; | ||
| 15 | } | ||
| 4 | 16 | ||
| 5 | @Override | 17 | @Override |
| 6 | public int getIndex() { | 18 | public int getIndex() { |
| @@ -13,14 +25,12 @@ public final class LoadMarketStateMenuCommand implements MenuCommand { | |||
| 13 | } | 25 | } |
| 14 | 26 | ||
| 15 | @Override | 27 | @Override |
| 16 | public boolean allowed() { | ||
| 17 | // TODO Auto-generated method stub | ||
| 18 | throw new UnsupportedOperationException("Unimplemented method 'allowed'"); | ||
| 19 | } | ||
| 20 | |||
| 21 | @Override | ||
| 22 | public void execute() { | 28 | public void execute() { |
| 23 | // TODO Auto-generated method stub | 29 | var path = io.readPath("Which state file to load? "); |
| 24 | throw new UnsupportedOperationException("Unimplemented method 'execute'"); | 30 | var result = context.restoreState(Path.of(path)); |
| 31 | |||
| 32 | if (result.isSuccess()) { | ||
| 33 | io.println("Restored %d event(s) from %s.".formatted(result.getData().eventsLoaded(), path)); | ||
| 34 | } | ||
| 25 | } | 35 | } |
| 26 | } | 36 | } |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/MenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/MenuCommand.java index 50acdac..8d35112 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/MenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/MenuCommand.java | |||
| @@ -5,8 +5,6 @@ public interface MenuCommand { | |||
| 5 | 5 | ||
| 6 | String getName(); | 6 | String getName(); |
| 7 | 7 | ||
| 8 | boolean allowed(); | ||
| 9 | |||
| 10 | void execute(); | 8 | void execute(); |
| 11 | 9 | ||
| 12 | default boolean isExit() { | 10 | default boolean isExit() { |
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/SaveMarketStateMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/SaveMarketStateMenuCommand.java index 2f950f0..27dfdde 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/SaveMarketStateMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/SaveMarketStateMenuCommand.java | |||
| @@ -25,12 +25,6 @@ public final class SaveMarketStateMenuCommand implements MenuCommand { | |||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | public boolean allowed() { | ||
| 29 | // TODO Auto-generated method stub | ||
| 30 | throw new UnsupportedOperationException("Unimplemented method 'allowed'"); | ||
| 31 | } | ||
| 32 | |||
| 33 | @Override | ||
| 34 | public void execute() { | 28 | public void execute() { |
| 35 | var path = io.readPath("Save to: "); | 29 | var path = io.readPath("Save to: "); |
| 36 | 30 | ||
diff --git a/ui-console/src/main/java/market/guess/ui/console/command/SettleEventMenuCommand.java b/ui-console/src/main/java/market/guess/ui/console/command/SettleEventMenuCommand.java index 9b62be5..b7344e3 100644 --- a/ui-console/src/main/java/market/guess/ui/console/command/SettleEventMenuCommand.java +++ b/ui-console/src/main/java/market/guess/ui/console/command/SettleEventMenuCommand.java | |||
| @@ -23,12 +23,6 @@ public final class SettleEventMenuCommand implements MenuCommand { | |||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | @Override | 25 | @Override |
| 26 | public boolean allowed() { | ||
| 27 | // TODO Auto-generated method stub | ||
| 28 | throw new UnsupportedOperationException("Unimplemented method 'allowed'"); | ||
| 29 | } | ||
| 30 | |||
| 31 | @Override | ||
| 32 | public void execute() { | 26 | public void execute() { |
| 33 | // TODO Auto-generated method stub | 27 | // TODO Auto-generated method stub |
| 34 | throw new UnsupportedOperationException("Unimplemented method 'execute'"); | 28 | throw new UnsupportedOperationException("Unimplemented method 'execute'"); |
diff --git a/ui-console/src/main/java/market/guess/ui/console/io/InputProcessor.java b/ui-console/src/main/java/market/guess/ui/console/io/InputProcessor.java index b6d5405..912ca25 100644 --- a/ui-console/src/main/java/market/guess/ui/console/io/InputProcessor.java +++ b/ui-console/src/main/java/market/guess/ui/console/io/InputProcessor.java | |||
| @@ -3,6 +3,7 @@ package market.guess.ui.console.io; | |||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import java.util.Scanner; | 4 | import java.util.Scanner; |
| 5 | import java.util.function.Function; | 5 | import java.util.function.Function; |
| 6 | import market.guess.api.MarketStateDTO; | ||
| 6 | 7 | ||
| 7 | public final class InputProcessor { | 8 | public final class InputProcessor { |
| 8 | private final Scanner scanner = new Scanner(System.in); | 9 | private final Scanner scanner = new Scanner(System.in); |
| @@ -21,14 +22,45 @@ public final class InputProcessor { | |||
| 21 | 22 | ||
| 22 | public void splashScreen() { | 23 | public void splashScreen() { |
| 23 | newLine(); | 24 | newLine(); |
| 24 | IO.println("<<- GUESS MARKET ->>"); | 25 | IO.println(padLeft("<<- GUESS MARKET ->>", 36)); |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | public void printState() { | 28 | public void printState(MarketStateDTO state) { |
| 28 | nextLine(); | 29 | newLine(); |
| 29 | println(" Option | Value | Shares "); | 30 | println( |
| 31 | "%s|%s%s|%s" | ||
| 32 | .formatted( | ||
| 33 | padAround("Option", 18), space(10), padLeft("Value", 8), padRight("Shares", 8))); | ||
| 30 | 34 | ||
| 35 | for (var market : state.markets()) { | ||
| 36 | println( | ||
| 37 | "%s|%s%s|%s" | ||
| 38 | .formatted( | ||
| 39 | padAround(market.name(), 18), | ||
| 40 | space(10), | ||
| 41 | padLeft(market.price(), 8), | ||
| 42 | padRight(market.volume(), 8))); | ||
| 43 | } | ||
| 31 | newLine(); | 44 | newLine(); |
| 45 | |||
| 46 | print("Event ledger balance: ".formatted(state.accountBalance())); | ||
| 47 | print("Commission collected: ".formatted(state.commissionCollected())); | ||
| 48 | } | ||
| 49 | |||
| 50 | private static String space(int width) { | ||
| 51 | return " ".repeat(width); | ||
| 52 | } | ||
| 53 | |||
| 54 | private static String padAround(String input, int width) { | ||
| 55 | return input.length() >= width ? input : padRight(padLeft(input, width / 2), width / 2); | ||
| 56 | } | ||
| 57 | |||
| 58 | private static String padRight(String input, int width) { | ||
| 59 | return input.length() >= width ? input : input + " ".repeat(width - input.length()); | ||
| 60 | } | ||
| 61 | |||
| 62 | private static String padLeft(String input, int width) { | ||
| 63 | return input.length() >= width ? input : " ".repeat(width - input.length()) + input; | ||
| 32 | } | 64 | } |
| 33 | 65 | ||
| 34 | public String readLine(String prompt) { | 66 | public String readLine(String prompt) { |
| @@ -92,7 +124,6 @@ public final class InputProcessor { | |||
| 92 | } | 124 | } |
| 93 | 125 | ||
| 94 | public <T> T readSelect(String prompt, List<T> items, Function<T, String> function) { | 126 | public <T> T readSelect(String prompt, List<T> items, Function<T, String> function) { |
| 95 | |||
| 96 | for (var i = 0; i < items.size(); i++) { | 127 | for (var i = 0; i < items.size(); i++) { |
| 97 | IO.println(" [%d]->> %s".formatted(i + 1, function.apply(items.get(i)))); | 128 | IO.println(" [%d]->> %s".formatted(i + 1, function.apply(items.get(i)))); |
| 98 | } | 129 | } |