@Test(expected = RuntimeException.class) public void fullResInitialFloatThrowsException() { max.handleFullResMetric(123f); }
@Override void handleFullResMetric(Object o) throws RuntimeException { if (o instanceof Double) { if (init) { this.setDoubleValue((Double)o); this.init = false; return; } if (!this.isFloatingPoint()) { if ((double)this.toLong() < (Double)o) { this.setDoubleValue((Double)o); } } else { this.setDoubleValue(Math.max(this.toDouble(), (Double)o)); } } else if (o instanceof Long || o instanceof Integer) { Long val; if (o instanceof Integer) { val = ((Integer)o).longValue(); } else { val = (Long)o; } if (init) { this.setLongValue(val); this.init = false; return; } if (this.isFloatingPoint()) { double doubleValOther = val.doubleValue(); if (this.toDouble()< doubleValOther) { this.setLongValue(val); } } else { this.setLongValue(Math.max(this.toLong(), val)); } } else { throw new RuntimeException("Unsuppored type " + o.getClass().getName() +" for min"); } }
MaxValue extends AbstractRollupStat { @Override void handleFullResMetric(Object o) throws RuntimeException { if (o instanceof Double) { if (init) { this.setDoubleValue((Double)o); this.init = false; return; } if (!this.isFloatingPoint()) { if ((double)this.toLong() < (Double)o) { this.setDoubleValue((Double)o); } } else { this.setDoubleValue(Math.max(this.toDouble(), (Double)o)); } } else if (o instanceof Long || o instanceof Integer) { Long val; if (o instanceof Integer) { val = ((Integer)o).longValue(); } else { val = (Long)o; } if (init) { this.setLongValue(val); this.init = false; return; } if (this.isFloatingPoint()) { double doubleValOther = val.doubleValue(); if (this.toDouble()< doubleValOther) { this.setLongValue(val); } } else { this.setLongValue(Math.max(this.toLong(), val)); } } else { throw new RuntimeException("Unsuppored type " + o.getClass().getName() +" for min"); } } }
MaxValue extends AbstractRollupStat { @Override void handleFullResMetric(Object o) throws RuntimeException { if (o instanceof Double) { if (init) { this.setDoubleValue((Double)o); this.init = false; return; } if (!this.isFloatingPoint()) { if ((double)this.toLong() < (Double)o) { this.setDoubleValue((Double)o); } } else { this.setDoubleValue(Math.max(this.toDouble(), (Double)o)); } } else if (o instanceof Long || o instanceof Integer) { Long val; if (o instanceof Integer) { val = ((Integer)o).longValue(); } else { val = (Long)o; } if (init) { this.setLongValue(val); this.init = false; return; } if (this.isFloatingPoint()) { double doubleValOther = val.doubleValue(); if (this.toDouble()< doubleValOther) { this.setLongValue(val); } } else { this.setLongValue(Math.max(this.toLong(), val)); } } else { throw new RuntimeException("Unsuppored type " + o.getClass().getName() +" for min"); } } MaxValue(); @SuppressWarnings("unused") // used by Jackson  MaxValue(long value); @SuppressWarnings("unused") // used by Jackson  MaxValue(double value); }
MaxValue extends AbstractRollupStat { @Override void handleFullResMetric(Object o) throws RuntimeException { if (o instanceof Double) { if (init) { this.setDoubleValue((Double)o); this.init = false; return; } if (!this.isFloatingPoint()) { if ((double)this.toLong() < (Double)o) { this.setDoubleValue((Double)o); } } else { this.setDoubleValue(Math.max(this.toDouble(), (Double)o)); } } else if (o instanceof Long || o instanceof Integer) { Long val; if (o instanceof Integer) { val = ((Integer)o).longValue(); } else { val = (Long)o; } if (init) { this.setLongValue(val); this.init = false; return; } if (this.isFloatingPoint()) { double doubleValOther = val.doubleValue(); if (this.toDouble()< doubleValOther) { this.setLongValue(val); } } else { this.setLongValue(Math.max(this.toLong(), val)); } } else { throw new RuntimeException("Unsuppored type " + o.getClass().getName() +" for min"); } } MaxValue(); @SuppressWarnings("unused") // used by Jackson  MaxValue(long value); @SuppressWarnings("unused") // used by Jackson  MaxValue(double value); @Override byte getStatType(); }
MaxValue extends AbstractRollupStat { @Override void handleFullResMetric(Object o) throws RuntimeException { if (o instanceof Double) { if (init) { this.setDoubleValue((Double)o); this.init = false; return; } if (!this.isFloatingPoint()) { if ((double)this.toLong() < (Double)o) { this.setDoubleValue((Double)o); } } else { this.setDoubleValue(Math.max(this.toDouble(), (Double)o)); } } else if (o instanceof Long || o instanceof Integer) { Long val; if (o instanceof Integer) { val = ((Integer)o).longValue(); } else { val = (Long)o; } if (init) { this.setLongValue(val); this.init = false; return; } if (this.isFloatingPoint()) { double doubleValOther = val.doubleValue(); if (this.toDouble()< doubleValOther) { this.setLongValue(val); } } else { this.setLongValue(Math.max(this.toLong(), val)); } } else { throw new RuntimeException("Unsuppored type " + o.getClass().getName() +" for min"); } } MaxValue(); @SuppressWarnings("unused") // used by Jackson  MaxValue(long value); @SuppressWarnings("unused") // used by Jackson  MaxValue(double value); @Override byte getStatType();  }