@Test public void testAggregateAvg() { try { agg = new AggregateAvg(null); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } try { agg = new AggregateAvg(String.class); fail(); } catch (IllegalArgumentException e) { Assert.assertTrue(true); } }
public AggregateAvg(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Integer.class) || (type == int.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Double.class) || (type == double.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if ((type == Float.class) || (type == float.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if (type == BigDecimal.class) { this.resultType = BigDecimal.class; concreteAvg = new AggregateAvgDecimal(); } }
AggregateAvg extends AbstractAggregate { public AggregateAvg(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Integer.class) || (type == int.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Double.class) || (type == double.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if ((type == Float.class) || (type == float.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if (type == BigDecimal.class) { this.resultType = BigDecimal.class; concreteAvg = new AggregateAvgDecimal(); } } }
AggregateAvg extends AbstractAggregate { public AggregateAvg(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Integer.class) || (type == int.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Double.class) || (type == double.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if ((type == Float.class) || (type == float.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if (type == BigDecimal.class) { this.resultType = BigDecimal.class; concreteAvg = new AggregateAvgDecimal(); } } AggregateAvg(Class< ? > type); }
AggregateAvg extends AbstractAggregate { public AggregateAvg(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Integer.class) || (type == int.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Double.class) || (type == double.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if ((type == Float.class) || (type == float.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if (type == BigDecimal.class) { this.resultType = BigDecimal.class; concreteAvg = new AggregateAvgDecimal(); } } AggregateAvg(Class< ? > type); @Override void enter(Object value, boolean filter); @Override void leave(Object value, boolean filter); @Override Object getValue(); @Override void clear(); IAggregate cloneAggregate(); @Override Class< ? > getValueType(); }
AggregateAvg extends AbstractAggregate { public AggregateAvg(Class< ? > type) { super(type); if (null == type) { String msg = "Type is null."; LOG.error(msg); throw new IllegalArgumentException(msg); } if (!StreamClassUtil.isNumberic(type)) { String msg = "Type is not numberic type."; LOG.error(msg); throw new IllegalArgumentException(msg); } if ((type == Long.class) || (type == long.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Integer.class) || (type == int.class)) { this.resultType = Long.class; concreteAvg = new AggregateAvgLong(); } if ((type == Double.class) || (type == double.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if ((type == Float.class) || (type == float.class)) { this.resultType = Double.class; concreteAvg = new AggregateAvgDouble(); } if (type == BigDecimal.class) { this.resultType = BigDecimal.class; concreteAvg = new AggregateAvgDecimal(); } } AggregateAvg(Class< ? > type); @Override void enter(Object value, boolean filter); @Override void leave(Object value, boolean filter); @Override Object getValue(); @Override void clear(); IAggregate cloneAggregate(); @Override Class< ? > getValueType();  }