package fr.lifl.stc.stan.util;
import java.io.File;
public class Utils {
public static String createRep(String nameRep) {
File f = new File(nameRep);
String name = "";
if(!f.isDirectory()){
if (f.mkdirs()) {
name = f.getPath();
}
}
else
name = f.getPath();
if(!name.equals(""))
name +="/";
return name;
}
/**
* merges 2 arrays , a1
and a2
into the first array.
* The result must contain only distinct elements
* @param a1
* @param index1 the length of the first array initialy
* @param a2
* @return the new length of the array resulted
*/
public static int merge(int[]a1, int index1, int[] a2){
boolean found;
for(int i = 0 ; i < a2.length && a2[i]!=-1; i++) {
int j = 0;
found = false;
for(; j