1 2 package org.objectweb.jac.samples.contacts; 3 4 import java.util.Random ; 5 6 public class Create { 7 8 12 public static void main( String [] params ) { 13 int n = new Integer (params[0]).intValue(); 14 String firstNames[] = new String [] { 15 "Laurent", "Renaud", "Maxime", "Matthieu", "Jérôme", 16 "Clément", "Thibault", "Carole", "Sonia", "Marie", "Mathilde", 17 "Frédéric", "Jean-Baptiste", "Nicolas", "Nathalie", "Grégoire", 18 "Marek", "Ania", "Sébastien", "Xavier", "Marta", "Annie", 19 "Philippe", "Béatrice", "Vincent" }; 20 System.out.println( "Creating "+n+" contacts..." ); 21 ContactRepository cr = new ContactRepository(); 22 new FilteredContacts(cr); 23 Random rnd = new Random (); 24 for (int i=0; i<n; i++) { 25 System.out.print( ""+i+" " ); 26 cr.addContact( 27 new Person("Contact"+i, 28 firstNames[rnd.nextInt(firstNames.length)], 29 "", 30 "contact"+i+"@contacts.org" 31 )); 32 } 33 } 34 } 35 | Popular Tags |