package UI;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

/**
 *
 * @author Marcel
 */
public class BatchOutput {
    /**
    * Simple batch output, print elements from List by group of 50,
    * and then ask, if print more
    * @param res List to print
    */
    public static <E> void BatchPrint(List<E> res){
        try{
            BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
            for(int i=0;i<res.size()/50+1;i++){
                for(int j=0;j<50;j++){
                    if(i*50+j>=res.size())
                        return;
                    System.out.println(res.get(i*50+j));
                }
                System.out.println("Vypísať viac? 1/0");
                String in = input.readLine();
                if(in.equals("0"))
                    return;
            }
        }catch(IOException e){
            System.out.println(e);
        }
    }
}
