@Override
	protected Scalar aggregate(ActivityContext context, Vector vector) throws ActivityException {
		if(vector == null || vector.isEmpty()) {
			return new Scalar(false);
		}
		boolean or = true;
		for(Object object : vector) {
			if(object instanceof Boolean) {
				Boolean bool = (Boolean)object;
				or = or && bool;
			} else {
				// TODO: implement the type mapper!!!!
				logger.error("arguments to logic operators must be boolean, while an instance of {} was received", object.getClass().getName());
				throw new InvalidArgumentException("Arguments to boolean operators must be boolean");
			}
			if(or) break;
		}
		return new Scalar(or);
	}
@ Override protected Scalar aggregate ( ActivityContext context , Vector vector ) throws ActivityException { if ( vector == null || vector . isEmpty ( ) ) { return new Scalar ( false ) ; } boolean or = true ; for ( Object object : vector ) { if ( object instanceof Boolean ) { Boolean bool = ( Boolean ) object ; or = or && bool ; } else { logger . error ( "arguments to logic operators must be boolean, while an instance of {} was received" , object . getClass ( ) . getName ( ) ) ; throw new InvalidArgumentException ( "Arguments to boolean operators must be boolean" ) ; } if ( or ) break ; } return new Scalar ( or ) ; }
@see org.dihedron.patterns.activities.base.AbstractAggregator#aggregate(org.dihedron.patterns.activities.ActivityContext, org.dihedron.patterns.activities.types.Vector)