@Test public void testMultiple() { ListZoomContext ctxt = new ListZoomContext(Arrays.asList(5000000d, 2000000d, 1000000d)); assertThat(ctxt.getScaleDenominator(-1), is(Double.POSITIVE_INFINITY)); assertThat(ctxt.getScaleDenominator(0), closeTo(5000000, EPSILON)); assertThat(ctxt.getScaleDenominator(1), closeTo(2000000, EPSILON)); assertThat(ctxt.getScaleDenominator(2), closeTo(1000000, EPSILON)); assertThat(ctxt.getScaleDenominator(3), is(0d)); }
@Override public double getScaleDenominator(int level) { final int i = level - initial; if (i < 0) return Double.POSITIVE_INFINITY; if (i >= scales.size()) return 0; return scales.get(i); }
ListZoomContext extends MedialZoomContext { @Override public double getScaleDenominator(int level) { final int i = level - initial; if (i < 0) return Double.POSITIVE_INFINITY; if (i >= scales.size()) return 0; return scales.get(i); } }
ListZoomContext extends MedialZoomContext { @Override public double getScaleDenominator(int level) { final int i = level - initial; if (i < 0) return Double.POSITIVE_INFINITY; if (i >= scales.size()) return 0; return scales.get(i); } ListZoomContext(List<Double> scales, int initial);  ListZoomContext(List<Double> scales); }
ListZoomContext extends MedialZoomContext { @Override public double getScaleDenominator(int level) { final int i = level - initial; if (i < 0) return Double.POSITIVE_INFINITY; if (i >= scales.size()) return 0; return scales.get(i); } ListZoomContext(List<Double> scales, int initial);  ListZoomContext(List<Double> scales); static void validate(List<Double> scales); @Override double getScaleDenominator(int level); @Override double getMedialScale(int level); @Override boolean isInRange(int level); }
ListZoomContext extends MedialZoomContext { @Override public double getScaleDenominator(int level) { final int i = level - initial; if (i < 0) return Double.POSITIVE_INFINITY; if (i >= scales.size()) return 0; return scales.get(i); } ListZoomContext(List<Double> scales, int initial);  ListZoomContext(List<Double> scales); static void validate(List<Double> scales); @Override double getScaleDenominator(int level); @Override double getMedialScale(int level); @Override boolean isInRange(int level);  }