	public SelectQuery buildQuery() {
		SelectQuery query = new SelectQuery(Component.class);
		Expression e = null;
        ...
        //mostly pseudocode for simplicity's sake.
        //e is a qualifier expression which may already have terms in it, but may not
		if (desiredAverageRating isn't null and not ignoring averageRating) {
			if (e is not null) {
				if (expressionType is and) {
					e =
						e.andExp(
							ExpressionFactory.matchExp(
								"averageRating.rating",
								desiredAverageRating));
				} else {
					e =
						e.orExp(
							ExpressionFactory.matchExp(
								"averageRating.rating",
								desiredAverageRating));
				}
			} else { //if e== null, then, no previous modifier. 
				e =
					ExpressionFactory.matchExp(
						"averageRating.rating",
						desiredAverageRating);
			}
			expressionType = get next expression type;
		}

		if (e != null) {
			query.setQualifier(e);
		}
		
		return query;
	}

}

