@Test public void testDispose() { Geometry.DEFAULT_POOL_SIZE = 1; Geometry geometry = new Geometry(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularHexagonsAvailable()); RegularHexagon hexagon = geometry.regularHexagon(); org.junit.Assert.assertEquals(0, geometry.getTotalRegularHexagonsAvailable()); hexagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularHexagonsAvailable()); hexagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularHexagonsAvailable()); hexagon = geometry.regularHexagon(); org.junit.Assert.assertEquals(0, geometry.getTotalRegularHexagonsAvailable()); hexagon.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalRegularHexagonsAvailable()); }
@Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); }
RegularHexagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } }
RegularHexagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularHexagon(float centerX, float centerY, float radius);  RegularHexagon(Geometry geometry); }
RegularHexagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularHexagon(float centerX, float centerY, float radius);  RegularHexagon(Geometry geometry); @Override void dispose(); }
RegularHexagon extends RegularPolygon { @Override public void dispose() { if(disposed) { return; } disposed = true; clearPositionChangeListeners(); clearSizeChangeListeners(); if(geometry == null) { return; } geometry.release(this); } RegularHexagon(float centerX, float centerY, float radius);  RegularHexagon(Geometry geometry); @Override void dispose(); static final float ROTATION_SYMMETRY; }