package devinfalgoust.sqlquerygenerator; import java.util.List; import java.util.ArrayList; /** * This is a Generic class that houses a list of Query objects. * It's main purpose is to house a series of queries and print * them all simultaneously using its generateAll function. * * @author Devin Falgoust */ public class Queries { // List of Query objects private List queries; // Constructor initializing the List of Query objects public Queries() { queries = new ArrayList(); } /** * This function returns a String holding all of the Strings * generated by each Query's generate function, all sepearated * by a newline. * * @return */ public String generateAll() { StringBuilder all = new StringBuilder(); for (Query query : queries) { all.append(query.generate()).append("\n"); } return all.toString(); } /** * This function allows you to add a Query to the List * * @param query - Query object to add to the List */ public void addQuery(Query query) { queries.add(query); } }