cool-core/src/main/java/com/nus/cool/core/cohort/ExtendedCohortSelection.java
private boolean filterByBirthAggregation() {
		boolean r = true;
		FieldFilter filter;
		Map<String, FieldFilter> filters;
		for (int i = 0; r && i < birthAggFilters.size(); i++) {
			filters = this.birthAggFilters.get(i);

			for (Map.Entry<String, FieldFilter> entry : filters.entrySet()) {
				Double birthAttr = getBirthAttribute(i, tableSchema.getFieldID(entry.getKey()));

				if (birthAttr == null)
					return false; // aggregation value does not exist

				if (entry.getValue() instanceof SetFieldFilter) {
					r = r && entry.getValue().accept(birthAttr.intValue());
				} else {
					filter = entry.getValue();
					ExtendedFieldSet.FieldValue value = filter.getFieldSet().getFieldValue();
					if (value.getType() != ExtendedFieldSet.FieldValueType.AbsoluteValue) {
						filter.updateValues(
								getBirthAttribute(value.getBaseEvent(), tableSchema.getFieldID(value.getBaseField())));
					}
					r = r && filter.accept(birthAttr.intValue());
				}

				if (!r)
					return r;
			}
		}
		return r;
	}
/**
	 * @brief check for each birth event if its aggregated value passes the
	 *        aggregation filter or not
	 *
	 * @return true if passes; false otherwise
	 */
@brief check for each birth event if its aggregated value passes the
aggregation filter or not

@return true if passes; false otherwise
@brief check for each birth event if its aggregated value passes the aggregation filter or not @return true if passes ; false otherwise
private boolean filterByBirthAggregation() {
		boolean r = true;
		FieldFilter filter;
		Map<String, FieldFilter> filters;
		for (int i = 0; r && i < birthAggFilters.size(); i++) {
			filters = this.birthAggFilters.get(i);
			for (Map.Entry<String, FieldFilter> entry : filters.entrySet()) {
				Double birthAttr = getBirthAttribute(i, tableSchema.getFieldID(entry.getKey()));
				if (birthAttr == null)
					return false; 
				if (entry.getValue() instanceof SetFieldFilter) {
					r = r && entry.getValue().accept(birthAttr.intValue());
				} else {
					filter = entry.getValue();
					ExtendedFieldSet.FieldValue value = filter.getFieldSet().getFieldValue();
					if (value.getType() != ExtendedFieldSet.FieldValueType.AbsoluteValue) {
						filter.updateValues(
								getBirthAttribute(value.getBaseEvent(), tableSchema.getFieldID(value.getBaseField())));
					}
					r = r && filter.accept(birthAttr.intValue());
				}
				if (!r)
					return r;
			}
		}
		return r;
	}
private boolean filterByBirthAggregation ( ) { boolean r = true ; FieldFilter filter ; Map < String , FieldFilter > filters ; for ( int i = 0 ; r && i < birthAggFilters . size ( ) ; i ++ ) { filters = this . birthAggFilters . get ( i ) ; for ( Map . Entry < String , FieldFilter > entry : filters . entrySet ( ) ) { Double birthAttr = getBirthAttribute ( i , tableSchema . getFieldID ( entry . getKey ( ) ) ) ; if ( birthAttr == null ) return false ; if ( entry . getValue ( ) instanceof SetFieldFilter ) { r = r && entry . getValue ( ) . accept ( birthAttr . intValue ( ) ) ; } else { filter = entry . getValue ( ) ; ExtendedFieldSet . FieldValue value = filter . getFieldSet ( ) . getFieldValue ( ) ; if ( value . getType ( ) != ExtendedFieldSet . FieldValueType . AbsoluteValue ) { filter . updateValues ( getBirthAttribute ( value . getBaseEvent ( ) , tableSchema . getFieldID ( value . getBaseField ( ) ) ) ) ; } r = r && filter . accept ( birthAttr . intValue ( ) ) ; } if ( ! r ) return r ; } } return r ; }
@brief check for each birth event if its aggregated value passes the
        aggregation filter or not
@brief check for each birth event if its aggregated value passes the aggregation filter or not
// aggregation value does not exist