From f3fa5dc47ef1d8830d69ca5f6c8156dd983cd5c7 Mon Sep 17 00:00:00 2001
From: Dominique Blouin <dominique.blouin@telecom-paristech.fr>
Date: Wed, 12 Oct 2016 13:20:58 +0000
Subject: [PATCH] Use of generics

---
 src/automata/State.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/automata/State.java b/src/automata/State.java
index dfbb6ef6a1..360adb52c0 100755
--- a/src/automata/State.java
+++ b/src/automata/State.java
@@ -50,10 +50,10 @@ import java.util.*;
 
 public class State {
     private String name;
-    private LinkedList transitions;
+    private LinkedList<Transition> transitions;
     
     public State(String _name) {
-         transitions = new LinkedList();
+         transitions = new LinkedList<Transition>();
          name = _name;
     }
     
@@ -61,12 +61,12 @@ public class State {
         return transitions.size();
     }
     
-    public LinkedList getTransitions() {
+    public LinkedList<Transition> getTransitions() {
         return transitions;
     }
     
     public Transition getTransition(int index) {
-        return (Transition)(transitions.get(index));
+        return transitions.get(index);
     }
     
     public String getName() {
@@ -86,9 +86,9 @@ public class State {
         StringBuffer sb = new StringBuffer("");
         Transition tr;
         
-        ListIterator iterator = transitions.listIterator();
+        ListIterator<Transition> iterator = transitions.listIterator();
         while(iterator.hasNext()) {
-            tr = (Transition)(iterator.next());
+            tr = iterator.next();
             sb.append("(" + name + ", \"" + tr.getValue() + "\", " + tr.getNextState().getName() + ")\n");
         }
         return new String(sb);
-- 
GitLab