CategorizedPoint extends AbstractCategorizedLegend<PointParameters> implements SymbolUom, EnablesStroke, OnVertexOnInterior { @Override public PointParameters remove(Object o) { if(!(o instanceof Double)){ throw new IllegalArgumentException("Keys are double values in this map"); } Double inp = (Double)o; forceMapping(inp); PointParameters ret; if(containsKey(inp)){ ret = get(inp); } else { return null; } if(strokeEnabled){ colorStroke.remove(inp); opacityStroke.remove(inp); widthStroke.remove(inp); dashStroke.remove(inp); } colorFill.remove(inp); opacityFill.remove(inp); widthSymbol.remove(inp); heightSymbol.remove(inp); wkn.remove(inp); return ret; } CategorizedPoint();  CategorizedPoint(PointSymbolizer sym); @Override List<CategorizedLegend> getCategorizedLegend(); @Override Symbolizer getSymbolizer(); @Override String getLegendTypeName(); @Override PointParameters get(Object o); @Override PointParameters put(Double d, PointParameters pp); @Override PointParameters remove(Object o); @Override boolean isStrokeEnabled(); @Override void setStrokeEnabled(boolean enable); @Override void setFallbackParameters(PointParameters fallback); @Override PointParameters getFallbackParameters(); @Override void setOnVertex(); @Override void setOnInterior(); @Override boolean isOnVertex(); @Override Uom getStrokeUom(); @Override void setStrokeUom(Uom u); @Override Uom getSymbolUom(); @Override void setSymbolUom(Uom u); @Override String getLegendTypeId(); static final String NAME; }
@Test public void testRemove() throws Exception { CategorizedPoint ca = getCategorizedPoint(); PointParameters tester = new PointParameters(Color.decode("#dd77ee"),.2,2.0,"1 1",Color.decode("#dd66ee"),.5,7.0,5.0,"STAR"); PointParameters rm = ca.remove(70000.0); assertTrue(tester.equals(rm)); tester = new PointParameters(Color.decode("#223344"),.2,2.0,"1 1",Color.decode("#113355"),.5,6.0,5.0,"SQUARE"); assertTrue(ca.get(Double.NEGATIVE_INFINITY).equals(tester)); tester = new PointParameters(Color.decode("#dd77ee"),.2,2.0,"1 1",Color.decode("#ffaa99"),.5,8.0,5.0,"CROSS"); assertTrue(ca.get(100000.0).equals(tester)); assertFalse(ca.containsKey(75000.0)); }
@Test public void testRemoveNoStroke() throws Exception { CategorizedPoint ca = getNoStroke(); PointParameters rm = ca.remove(100000.0); PointParameters tester = new PointParameters(Color.WHITE,.0,.0,"", Color.decode("#ffaa99"),.5,8.0,5.0,"CROSS"); assertTrue(rm.equals(tester)); }