@Test public void calculateValues_Nominal_Result() { ArrayList<Integer> toAssert = new ArrayList<>(); toAssert.add(0); toAssert.add(5); toAssert.add(10); assertEquals(toAssert, mXRndr.calculateValues(0, 8, 5)); }
ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } if (result.get(result.size() - 1) < max) result.add(pos); return result; }
AxisRenderer { ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } if (result.get(result.size() - 1) < max) result.add(pos); return result; } }
AxisRenderer { ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } if (result.get(result.size() - 1) < max) result.add(pos); return result; } AxisRenderer(); }
AxisRenderer { ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } if (result.get(result.size() - 1) < max) result.add(pos); return result; } AxisRenderer(); void init(ArrayList<ChartSet> data, Style style); abstract float parsePos(int index, double value); void reset(); float getInnerChartLeft(); float getInnerChartTop(); float getInnerChartRight(); float getInnerChartBottom(); float[] getInnerChartBounds(); int getStep(); float getBorderSpacing(); int getBorderMaximumValue(); int getBorderMinimumValue(); boolean hasMandatoryBorderSpacing(); boolean hasStep(); void setHandleValues(boolean bool); void setLabelsFormat(DecimalFormat format); void setStep(int step); void setBorderSpacing(float spacing); void setTopSpacing(float spacing); void setMandatoryBorderSpacing(boolean bool); void setInnerChartBounds(float left, float top, float right, float bottom); void setBorderValues(int min, int max, int step); void setBorderValues(int min, int max); }
AxisRenderer { ArrayList<Integer> calculateValues(int min, int max, int step) { ArrayList<Integer> result = new ArrayList<>(); int pos = min; while (pos <= max) { result.add(pos); pos += step; } if (result.get(result.size() - 1) < max) result.add(pos); return result; } AxisRenderer(); void init(ArrayList<ChartSet> data, Style style); abstract float parsePos(int index, double value); void reset(); float getInnerChartLeft(); float getInnerChartTop(); float getInnerChartRight(); float getInnerChartBottom(); float[] getInnerChartBounds(); int getStep(); float getBorderSpacing(); int getBorderMaximumValue(); int getBorderMinimumValue(); boolean hasMandatoryBorderSpacing(); boolean hasStep(); void setHandleValues(boolean bool); void setLabelsFormat(DecimalFormat format); void setStep(int step); void setBorderSpacing(float spacing); void setTopSpacing(float spacing); void setMandatoryBorderSpacing(boolean bool); void setInnerChartBounds(float left, float top, float right, float bottom); void setBorderValues(int min, int max, int step); void setBorderValues(int min, int max);  }