From 1e95c4bdc7494cdf5128c4dd5800e7e2c7675b50 Mon Sep 17 00:00:00 2001 From: Walcher Date: Fri, 5 Jan 2024 15:28:12 +0100 Subject: [PATCH] added basic methods, added basic variables --- .idea/.gitignore | 8 ++ .idea/checkstyle-idea.xml | 15 +++ .idea/compiler.xml | 14 ++ .idea/encodings.xml | 7 + .idea/jarRepositories.xml | 25 ++++ .idea/jpa-buddy.xml | 6 + .idea/misc.xml | 17 +++ .idea/uiDesigner.xml | 124 ++++++++++++++++++ .idea/vcs.xml | 6 + .../java/ab1/impl/GRUPPE/NFAFactoryImpl.java | 4 +- src/main/java/ab1/impl/GRUPPE/NFAImpl.java | 39 ++++-- target/classes/ab1/NFA.class | Bin 807 -> 895 bytes .../ab1/Transition$TransitionBuilder.class | Bin 1673 -> 1673 bytes target/classes/ab1/Transition.class | Bin 1866 -> 1866 bytes target/classes/ab1/impl/GRUPPE/NFAImpl.class | Bin 2053 -> 2181 bytes .../ab1/tests/FinalizeTests.class | Bin 4084 -> 4084 bytes 16 files changed, 255 insertions(+), 10 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/jpa-buddy.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..8dbefe7 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,15 @@ + + + + 10.12.5 + JavaOnly + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..7efc65a --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..2161097 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml new file mode 100644 index 0000000..966d5f5 --- /dev/null +++ b/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..fc48575 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java b/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java index cebf002..dadfdcf 100644 --- a/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java +++ b/src/main/java/ab1/impl/GRUPPE/NFAFactoryImpl.java @@ -6,6 +6,8 @@ import ab1.NFAFactory; public class NFAFactoryImpl implements NFAFactory { @Override public NFA buildNFA(String startState) { - return new NFAImpl(); + NFA nfa = new NFAImpl(startState); + + return nfa; } } diff --git a/src/main/java/ab1/impl/GRUPPE/NFAImpl.java b/src/main/java/ab1/impl/GRUPPE/NFAImpl.java index 72d4935..5508356 100644 --- a/src/main/java/ab1/impl/GRUPPE/NFAImpl.java +++ b/src/main/java/ab1/impl/GRUPPE/NFAImpl.java @@ -5,27 +5,45 @@ import ab1.NFA; import ab1.Transition; import java.util.Collection; +import java.util.HashSet; import java.util.Set; public class NFAImpl implements NFA { - @Override - public Set getStates() { - return null; + private Set states; + private Set transitions; + private String initialState; + private Set acceptingStates; + private boolean isFinalized; + + public NFAImpl(String startState) { + this.initialState = startState; + this.states = new HashSet<>(); + this.transitions = new HashSet<>(); + this.acceptingStates = new HashSet<>(); + this.isFinalized = false; } @Override - public Collection getTransitions() { - return null; + public Set getStates() { + + return this.states; } + @Override + public Collection getTransitions() { + + return this.transitions; + } + @Override public Set getAcceptingStates() { - return null; + + return this.acceptingStates; } @Override public String getInitialState() { - return null; + return this.initialState; } @Override @@ -38,11 +56,13 @@ public class NFAImpl implements NFA { } + // #TODO later @Override public NFA union(NFA other) throws FinalizedStateException { return null; } + // #TODO later @Override public NFA intersection(NFA other) throws FinalizedStateException { return null; @@ -70,12 +90,13 @@ public class NFAImpl implements NFA { @Override public boolean isFinalized() { - return false; + + return isFinalized; } @Override public void finalizeAutomaton() { - + this.isFinalized = true; } @Override diff --git a/target/classes/ab1/NFA.class b/target/classes/ab1/NFA.class index 77dcf84d19583530bcb2deb961245a4def9f9123..e728d8bbe2e56f70cdae4d4b8f637a89ca82db55 100644 GIT binary patch delta 315 zcmZ3^_MeUG)W2Q(7#J9A8Pq0nwOjI~r?b oS{fz<7m>jbk!6qrJ4~KI0Zc1G`AQ7R5aS?v85kK$SAPck-OeHU@nz1_K5|b_OFJ25AQ4$-kHmZDwJ~U}Du{U}Vsl IT*xK?05v`e+mW)249$#0lkH?y#0FtO?|FftfT IE@YDc02%lSS^xk5 diff --git a/target/classes/ab1/Transition.class b/target/classes/ab1/Transition.class index 55ad5d1eb3dbb31ef6b6d971c9c3789a565b3046..d83e6b5b1aa9a06868130b38faa7fe7b217ccb77 100644 GIT binary patch delta 79 zcmX@bcZzQV3o|nZgT>@u%-VwdYz($s40a6m>yEmmb=R<&VZW#C{i jXRu_jVz6d#W?*0tVqjtrVc=kJVc=wNWpHQkWRL^^K35Ba delta 79 zcmX@bcZzQV3$q|U8-oQGgC&C%JA*Y3gAIf2WM}3_%p45%li8WI7pt-`tC};gGH@{1 jF*q5cc1_lOO2AhpsnvDE>>8T|lMTvREnI)O|dBu~MWi_-kG<~uX%M$fV zOEPoxo%3^YQj|-hWZG_ll2%I8C5oKU<_iMEX%CUC_LGfS&NZtasjg?Bk$xl z%!-rw*%TOsCcj~pWS3@OWZ-7tnaszg$S6Mf4YMq(41+8K<75Fgc}W=t5e5bZ9tK7R z1_mYuQ3f#v1_nk3IR^R3ZY&DAN?=(r1}3m5L>45kz@W&$$e_f)z`(-5$e_%?$e_xg z2G*gDLx(zp2AU2{2Cc~tSQHtxCkL>Ki)u6Ipvmh(p|sBamed47=V1NYz1}^ zst=J}ZU|LpPe7d!RGkX}b;b-PlR4QHCx2k$;YNh0>Ev^4N{s%KKeCB3n?Y1a24gXa zk-?n7VzM*4B4Y%|U)+|Ua1(H3;AW7T+|I5d$%Ukc6%t5cc1_lOO2CI!+nv9cs7;6|6H*+!tF)~U_PGA&gw4NNvtjQ=extUpu zk#q7oW=lq%$vG^t%-jq-ll#~d83jQ+R!Iga2FA$~*yJU}7(^Ht7M85kIt7(^Mw z7#J8B8KfCxCLd!_(3JtpiZL*OMIo{vd07TI21W*X1_lNe21W)221W)Y24%1gMI1U* z7*x@8s4=KdPGD7JRGoZ*Ra{hqK@&}03o5ULLtYyyua84shd~$QV`USti%@-t>~cM* zI!glT^r7nP2&gk)Fr3`Ut|;z|MI9r9(PTe%B}UK5h3ult#t@Z~zF1Y7Fqlq0%&y27 y1o9uZ87TY&92vM7%qO#Rs7P`m>0yP$n}8z&KZE&X7Y-F!EV2xY3>M%xwgdo~6FfWs diff --git a/target/test-classes/ab1/tests/FinalizeTests.class b/target/test-classes/ab1/tests/FinalizeTests.class index 17e959cf098b9a1cb8c27f4e7235f4d31a592bea..1057bafae7db69c722b61096264d77c4a9790161 100644 GIT binary patch delta 254 zcmew&|3!X-3%k4k0~^&3{A>*KK)m@p4DDcp7J@V`;$c_} z(#VyZpIeZVnwy$e!q3LA6r^w&4?`1J+X^m*l?isoIBPDPwE)gq!q7YU4!;BdipD>+ delta 267 zcmew&|3!X-3%ejc8$%x#LqEd=c7};O43iipZ~n;6#8@xDz{bzUFpZ0Wk6}6wLnlKs zKPSUXZUz~KSv(B08RjrDaAoJDrskyvmn0T3GH`2X`XnY9>ifAlTJv)<%mXQ$&%>|) zq>!f|r?l9=Ahjs5B)^ECjbRbU%*8wm9SqILfHbb;VOS*#(#e&a zpIeZVnwy$e!q3LA2BdN=4?`0}^XAVSOW0g{8JHQSFid5b!T@2-fV1YpSqtH;C2-bq NIBPY-l*xDaB>*vlK#%|c