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 77dcf84..e728d8b 100644
Binary files a/target/classes/ab1/NFA.class and b/target/classes/ab1/NFA.class differ
diff --git a/target/classes/ab1/Transition$TransitionBuilder.class b/target/classes/ab1/Transition$TransitionBuilder.class
index 8deddb3..6a10a5f 100644
Binary files a/target/classes/ab1/Transition$TransitionBuilder.class and b/target/classes/ab1/Transition$TransitionBuilder.class differ
diff --git a/target/classes/ab1/Transition.class b/target/classes/ab1/Transition.class
index 55ad5d1..d83e6b5 100644
Binary files a/target/classes/ab1/Transition.class and b/target/classes/ab1/Transition.class differ
diff --git a/target/classes/ab1/impl/GRUPPE/NFAImpl.class b/target/classes/ab1/impl/GRUPPE/NFAImpl.class
index 8047aab..1affa84 100644
Binary files a/target/classes/ab1/impl/GRUPPE/NFAImpl.class and b/target/classes/ab1/impl/GRUPPE/NFAImpl.class differ
diff --git a/target/test-classes/ab1/tests/FinalizeTests.class b/target/test-classes/ab1/tests/FinalizeTests.class
index 17e959c..1057baf 100644
Binary files a/target/test-classes/ab1/tests/FinalizeTests.class and b/target/test-classes/ab1/tests/FinalizeTests.class differ