Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Catalog getCatalog() {
- Catalog cat = new Catalog();
- DBManager db = new DBManager();
- List<Laptop> l = db.getAllLaptops();
- int randomInt;
- String output = new String();
- for(int i = 0;i<5;i++){
- Random randomGenerator = new Random();
- randomInt = randomGenerator.nextInt(l.size());
- Laptop actual = l.get(randomInt);
- l.remove(randomInt);
- output += "\t\t\t------ "+actual.getModel() +" ("+actual.getBrand() +")" +" ------\n";
- output += "\t\t\t\t------ "+actual.getPrice() +" €"+" ------\n";
- output += "Settings:\nProcessor: "+actual.getProcessor() + "\n";
- output += "Processor: "+actual.getClock() + "\n";
- output += "RAM: "+actual.getRam()+"\n";
- output += "Graphics: "+actual.getGraphadap()+"\n";
- output += "Screen: "+actual.getScreensize()+" "+actual.getScreenres()+"\n";
- }
- cat.setPlacemark(output);
- return cat;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement