From 49a883614466b46fbefb8f24487e81a2896cdbfa Mon Sep 17 00:00:00 2001 From: schrom01 Date: Tue, 20 Sep 2022 20:54:04 +0200 Subject: [PATCH] =?UTF-8?q?Aufgabe=203=20gel=C3=B6st.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ch/zhaw/ads/BracketServer.java | 4 ++-- src/ch/zhaw/ads/WellformedXmlServer.java | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/ch/zhaw/ads/WellformedXmlServer.java diff --git a/src/ch/zhaw/ads/BracketServer.java b/src/ch/zhaw/ads/BracketServer.java index 71cf497..9cc6607 100644 --- a/src/ch/zhaw/ads/BracketServer.java +++ b/src/ch/zhaw/ads/BracketServer.java @@ -9,9 +9,9 @@ public class BracketServer implements CommandExecutor { return checkBrackets(command) ? "true" : "false"; } - public boolean checkBrackets(String command) { + public boolean checkBrackets (String arg) { Stack stack = new ListStack(); - char[] chars = command.toCharArray(); + char[] chars = arg.toCharArray(); for (char x: chars) { Character closingBracket = getClosingBracketForOpening(x); if(closingBracket != null){ diff --git a/src/ch/zhaw/ads/WellformedXmlServer.java b/src/ch/zhaw/ads/WellformedXmlServer.java new file mode 100644 index 0000000..d6425a8 --- /dev/null +++ b/src/ch/zhaw/ads/WellformedXmlServer.java @@ -0,0 +1,13 @@ +package ch.zhaw.ads; + +public class WellformedXmlServer implements CommandExecutor { + + @Override + public String execute(String command) throws Exception { + return checkWellformed(command) ? "true" : "false"; + } + + public boolean checkWellformed(String arg) { + + } +} \ No newline at end of file