<commit_before>/*
 * Copyright (c) 2009-2013 <NAME>
 */
package fi.tnie.db.expr;


public class Select
	extends AbstractClause {
	
	private ElementList<SelectListElement> selectList;	
	private boolean distinct;	
	
	public Select() {
		super(Keyword.SELECT);
	}

//	@Override
//	public void generate(SimpleQueryContext qc, StringBuffer dest) {
//		dest.append("SELECT ");
//		
//		if (isDistinct()) {
//			dest.append("DISTINCT ");
//		}
//		
//		getSelectList().generate(qc, dest);
//		dest.append(" ");
//	}
	

	public ElementList<SelectListElement> getSelectList() {
		if (selectList == null) {
			selectList = new ElementList<SelectListElement>();			
		}

		return selectList;
	}

	public void setDistinct(boolean distinct) {
		this.distinct = distinct;
	}

	public boolean isDistinct() {
		return distinct;
	}
	
	public SelectListElement add(SelectListElement e) {
		if (e == null) {
			throw new NullPointerException("'e' must not be null");
		}
		
		getSelectList().add(e);
		return e;
	}
	
	public ValueElement add(ValueExpression expr) {
		return add(expr, (ColumnName) null);
	}
	<commit_msg>Add constructor<commit_after>/*
 * Copyright (c) 2009-2013 <NAME>
 */
package fi.tnie.db.expr;


public class Select
	extends AbstractClause {
	
	private ElementList<SelectListElement> selectList;	
	private boolean distinct;	
	
	public Select() {
		super(Keyword.SELECT);
	}

//	@Override
//	public void generate(SimpleQueryContext qc, StringBuffer dest) {
//		dest.append("SELECT ");
//		
//		if (isDistinct()) {
//			dest.append("DISTINCT ");
//		}
//		
//		getSelectList().generate(qc, dest);
//		dest.append(" ");
//	}
	

	public ElementList<SelectListElement> getSelectList() {
		if (selectList == null) {
			selectList = new ElementList<SelectListElement>();			
		}

		return selectList;
	}

	public void setDistinct(boolean distinct) {
		this.distinct = distinct;
	}

	public boolean isDistinct() {
		return distinct;
	}
	
	public SelectListElement add(SelectListElement e) {
		if (e == null) {
			throw new NullPointerException("'e' must not be null");
		}
		
		getSelectList().add(e);
		return e;
	}
	
	public TableColumnExpr add(TableColumnExpr expr) {
		ValueExpression ve = expr;
		add(ve);
		return expr;
	}
	
	public ValueElement add(ValueExpression expr) {
		return add(expr, (ColumnName) null);
	}
	
{'fraction_non_alphanumeric': 0.13730569948186527, 'fraction_numerical': 0.0069084628670120895, 'mean_word_length': 3.588118811881188, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6936894', 'n_tokens_mistral': 859, 'n_tokens_neox': 764, 'n_words': 175}