package core;
import java.util.Arrays;


public enum Action {
	Apple("Apple"), Facebook("Facebook"), Trydea("Trydea"), Google("Google");

	private String name;
	

	private Action(String name) {
		this.name = name;
	}
	public static boolean estValide(String s) {
		for(Action a : Action.values())
			if(a.name.equalsIgnoreCase(s))
				return true;
		return false;
	}

	public static Action from(String s) {
		for(Action a : Action.values())
			if(a.name.equalsIgnoreCase(s))
				return a;
		System.out.println("ERROR Action.from " + s);
		return null;
	}
	public static int[] nomActions() {
		int n=Action.values().length;
		String[] vectName= new String[n];
		int[] vectPos= new int[n]; 
		for(int i=0;i<n;i++){
			vectName[i]=Action.values()[i].name;
		}
		Arrays.sort(vectName);
		
		for(int i=0;i<n;i++){
			for(int k=0;k<n;k++)
				if(vectName[k]==Action.values()[i].name){
					vectPos[k]=i;
					break;
				}
		}
		return vectPos;
	}
}

@@ -55,16 +55,73 @@
 ction %7B%0A
+%09//les actions sont %C3%A0 mettre dans l'ordre alphab%C3%A9tique !%0A
 %09Apple(%22
@@ -155,44 +155,44 @@
 %22), 
-Trydea(%22Trydea%22), Google(%22Google%22);%0A
+Google(%22Google%22), Trydea(%22Trydea%22); 
 %0A%09pr
@@ -608,392 +608,7 @@
 %0A%09%7D%0A
-%09public static int%5B%5D nomActions() %7B%0A%09%09int n=Action.values().length;%0A%09%09String%5B%5D vectName= new String%5Bn%5D;%0A%09%09int%5B%5D vectPos= new int%5Bn%5D; %0A%09%09for(int i=0;i%3Cn;i++)%7B%0A%09%09%09vectName%5Bi%5D=Action.values()%5Bi%5D.name;%0A%09%09%7D%0A%09%09Arrays.sort(vectName);%0A%09%09%0A%09%09for(int i=0;i%3Cn;i++)%7B%0A%09%09%09for(int k=0;k%3Cn;k++)%0A%09%09%09%09if(vectName%5Bk%5D==Action.values()%5Bi%5D.name)%7B%0A%09%09%09%09%09vectPos%5Bk%5D=i;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%7D%0A%09%09return vectPos;%0A%09%7D%0A
 %7D%0A
+%0A

Update Action.java