@Test public void testGetMaxX() { System.out.println("getMaxX"); GraphRowSumValues instance = new GraphRowSumValues(); instance.setGranulationValue(100); instance.setExcludeOutOfRangeValues(true); instance.add(1000, 10); instance.add(100000, 20); long expResult = 1000L; long result = instance.getMaxX(); Assert.assertEquals(expResult, result); instance.setExcludeOutOfRangeValues(false); expResult = 100000; result = instance.getMaxX(); Assert.assertEquals(expResult, result); }
@Override public long getMaxX() { if (!excludeOutOfRangeValues) { return super.getMaxX(); } else { long retMax = 0; Iterator<Long> iter = values.keySet().iterator(); if (iter.hasNext()) { retMax = iter.next(); } long excludeValue = getGranulationValue() * excludeCount; while (iter.hasNext()) { long value = iter.next(); if (value > retMax) { if ((value - retMax) < excludeValue) { retMax = value; } } } return retMax; } }
GraphRowSumValues extends AbstractGraphRow implements Iterator<Entry<Long, AbstractGraphPanelChartElement>> { @Override public long getMaxX() { if (!excludeOutOfRangeValues) { return super.getMaxX(); } else { long retMax = 0; Iterator<Long> iter = values.keySet().iterator(); if (iter.hasNext()) { retMax = iter.next(); } long excludeValue = getGranulationValue() * excludeCount; while (iter.hasNext()) { long value = iter.next(); if (value > retMax) { if ((value - retMax) < excludeValue) { retMax = value; } } } return retMax; } } }
GraphRowSumValues extends AbstractGraphRow implements Iterator<Entry<Long, AbstractGraphPanelChartElement>> { @Override public long getMaxX() { if (!excludeOutOfRangeValues) { return super.getMaxX(); } else { long retMax = 0; Iterator<Long> iter = values.keySet().iterator(); if (iter.hasNext()) { retMax = iter.next(); } long excludeValue = getGranulationValue() * excludeCount; while (iter.hasNext()) { long value = iter.next(); if (value > retMax) { if ((value - retMax) < excludeValue) { retMax = value; } } } return retMax; } } GraphRowSumValues();  GraphRowSumValues(boolean doRollingSum); }
GraphRowSumValues extends AbstractGraphRow implements Iterator<Entry<Long, AbstractGraphPanelChartElement>> { @Override public long getMaxX() { if (!excludeOutOfRangeValues) { return super.getMaxX(); } else { long retMax = 0; Iterator<Long> iter = values.keySet().iterator(); if (iter.hasNext()) { retMax = iter.next(); } long excludeValue = getGranulationValue() * excludeCount; while (iter.hasNext()) { long value = iter.next(); if (value > retMax) { if ((value - retMax) < excludeValue) { retMax = value; } } } return retMax; } } GraphRowSumValues();  GraphRowSumValues(boolean doRollingSum); @Override void setExcludeOutOfRangeValues(boolean excludeOutOfRangeValues); @Override void add(long xVal, double yVal); Iterator<Entry<Long, AbstractGraphPanelChartElement>> iterator(); boolean hasNext(); Entry<Long, AbstractGraphPanelChartElement> next(); void remove(); @Override int size(); @Override long getMaxX(); @Override AbstractGraphPanelChartElement getElement(long value); }
GraphRowSumValues extends AbstractGraphRow implements Iterator<Entry<Long, AbstractGraphPanelChartElement>> { @Override public long getMaxX() { if (!excludeOutOfRangeValues) { return super.getMaxX(); } else { long retMax = 0; Iterator<Long> iter = values.keySet().iterator(); if (iter.hasNext()) { retMax = iter.next(); } long excludeValue = getGranulationValue() * excludeCount; while (iter.hasNext()) { long value = iter.next(); if (value > retMax) { if ((value - retMax) < excludeValue) { retMax = value; } } } return retMax; } } GraphRowSumValues();  GraphRowSumValues(boolean doRollingSum); @Override void setExcludeOutOfRangeValues(boolean excludeOutOfRangeValues); @Override void add(long xVal, double yVal); Iterator<Entry<Long, AbstractGraphPanelChartElement>> iterator(); boolean hasNext(); Entry<Long, AbstractGraphPanelChartElement> next(); void remove(); @Override int size(); @Override long getMaxX(); @Override AbstractGraphPanelChartElement getElement(long value);  }