@Test public void testDispose() { Geometry.DEFAULT_POOL_SIZE = 1; Geometry geometry = new Geometry(); org.junit.Assert.assertEquals(1, geometry.getTotalLineSegmentsAvailable()); segment1 = geometry.lineSegment(); org.junit.Assert.assertEquals(0, geometry.getTotalLineSegmentsAvailable()); segment1.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalLineSegmentsAvailable()); segment1.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalLineSegmentsAvailable()); segment1 = geometry.lineSegment(); org.junit.Assert.assertEquals(0, geometry.getTotalLineSegmentsAvailable()); segment1.dispose(); org.junit.Assert.assertEquals(1, geometry.getTotalLineSegmentsAvailable()); }
public void dispose() { if(disposed) { return; } disposed = true; if(geometry == null) { return; } geometry.release(this); }
LineSegment implements Disposable { public void dispose() { if(disposed) { return; } disposed = true; if(geometry == null) { return; } geometry.release(this); } }
LineSegment implements Disposable { public void dispose() { if(disposed) { return; } disposed = true; if(geometry == null) { return; } geometry.release(this); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); }
LineSegment implements Disposable { public void dispose() { if(disposed) { return; } disposed = true; if(geometry == null) { return; } geometry.release(this); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); void dispose(); void setDisposed(boolean disposed); void set(float x1, float y1, float x2, float y2); boolean contains(float x, float y); boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2); boolean intersects(LineSegment lineSegment); @Deprecated Point getIntersection(LineSegment lineSegment); boolean getIntersection(LineSegment lineSegment, Point result); boolean intersects(Rectangle rectangle); Point getPointA(); void setPointA(Point pointA); Point getPointB(); void setPointB(Point pointB); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float getLength(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
LineSegment implements Disposable { public void dispose() { if(disposed) { return; } disposed = true; if(geometry == null) { return; } geometry.release(this); } LineSegment(Geometry geometry);  LineSegment(float x1, float y1, float x2, float y2);  LineSegment(Point pA, Point pB); void dispose(); void setDisposed(boolean disposed); void set(float x1, float y1, float x2, float y2); boolean contains(float x, float y); boolean intersectsLineSegment(float segmentX1, float segmentY1, float segmentX2, float segmentY2); boolean intersects(LineSegment lineSegment); @Deprecated Point getIntersection(LineSegment lineSegment); boolean getIntersection(LineSegment lineSegment, Point result); boolean intersects(Rectangle rectangle); Point getPointA(); void setPointA(Point pointA); Point getPointB(); void setPointB(Point pointB); float getMinX(); float getMinY(); float getMaxX(); float getMaxY(); float getLength(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }