Generate a specified number of false data

In fact, not a serious demand, just in time to draw page needs to put some random false data, and is best not to repeat. I put here only ten sets of false data too lazy to recapture, and written in a way to put here

Some randomly generated false data:

Private String getRandomInfo (String In Flag, int NUM) { 
    List <String> List = null ;
     int Sex = 0 ;
     int XB = 0 ;
     Switch (In Flag) {
     Case ". 1" :
         // Name Array 
        String [] nameArr = { " Harry denier "," Gadella "," Mina Er "," Bibinuer "," Morita mention " }; 
        List = Arrays.asList (nameArr);
         BREAK ;
     Case " 2 " :
         // document number array
        String [] = {zjhmArr "370,205,621,219,253", "370,206,501,122,483", "370,203,640,507,092", "370,206,390,709,161", "370,206,340,306,481" }; 
        List = Arrays.asList (zjhmArr);
         BREAK ;
     Case ". 3" :
         // residence detailed address array 
        String [] hjxzArr = { "YILI City xxx Street 1", "YILI City xxx Street, No. 2," "in Yili City xxx Street 3", "YILI City xxx Street 4", "YILI City xxx Street. 5 " }; 
        List = Arrays.asList (hjxzArr);
         BREAK ;
     Case ". 4 " :
         // now live detailed site array 
        String [] xzxzArr = {" xx Road 111 Lake District ","West Lake Road No. 222 xx", "xx Lake Road No. 333," "xx Lake Road No. 444", "xx Road, Xihu District No. 555" "222 Lake Road No. xx", "xx Lake Road No. 333", "444 Lake Road No. xx", "xx Road 555 West Lake District" };
        List= Arrays.asList(xzxzArr);
        break;
    case "5":
        xb = (int)(1+Math.random()*2);
        sex = 1;
        break;
    }
    if(sex == 0){
        return Object.toString(list.get(num));
    }else {
        return xb == 1?"男":"女";
    }
}

These are placed within the method call for loop, it is necessary to fill a particular num controls which set of data, flag array to class discrimination.
The number of pieces of data need to be generated, as for the number of cycles, the number of times the specified data can be generated out.

Note : You need to debug the page tabs. Now I only put up to 10 times.

Guess you like

Origin www.cnblogs.com/yuan-zhou/p/11969647.html