public class Geometry
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_POOL_SIZE
Default pool size.
|
| Constructor and Description |
|---|
Geometry() |
| Modifier and Type | Method and Description |
|---|---|
Circle |
circle()
Allocates a
Circle from the pool |
EquilateralTriangle |
equilateralTriangle()
Allocates a
EquilateralTriangle from the pool |
int |
getTotalCirclesAvailable()
Returns the total
Circle instances currently in the pool |
int |
getTotalEquilateralTrianglesAvailable()
Returns the total
EquilateralTriangle instances currently in the pool |
int |
getTotalLinesAvailable()
Returns the total
Line instances currently in the pool |
int |
getTotalLineSegmentsAvailable()
Returns the total
LineSegment instances currently in the pool |
int |
getTotalPointsAvailable()
Returns the total
Point instances currently in the pool |
int |
getTotalPolygonsAvailable()
Returns the total
Polygon instances currently in the pool |
int |
getTotalRectanglesAvailable()
Returns the total
Rectangle instances currently in the pool |
int |
getTotalRegularHexagonsAvailable()
Returns the total
RegularHexagon instances currently in the pool |
int |
getTotalRegularPentagonsAvailable()
Returns the total
RegularPentagon instances currently in the pool |
int |
getTotalTrianglesAvailable()
Returns the total
Triangle instances currently in the pool |
void |
init()
Initialises the pool
|
Line |
line()
Allocates a
Line from the pool |
LineSegment |
lineSegment()
Allocates a
LineSegment from the pool |
Point |
point()
Allocates a
Point from the pool |
Polygon |
polygon()
Allocates a
Polygon from the pool |
Polygon |
polygon(float[] vertices)
Allocates a
Polygon from the pool |
Rectangle |
rectangle()
Allocates a
Rectangle from the pool |
RegularHexagon |
regularHexagon()
Allocates a
RegularHexagon from the pool |
RegularPentagon |
regularPentagon()
Allocates a
RegularPentagon from the pool |
void |
release(Circle circle)
Releases a
Circle instance back to the pool |
void |
release(EquilateralTriangle equilateralTriangle)
Releases a
EquilateralTriangle instance back to the pool |
void |
release(Line line)
Releases a
Line instance back to the pool |
void |
release(LineSegment lineSegment)
Releases a
LineSegment instance back to the pool |
void |
release(Point point)
Releases a
Point instance back to the pool |
void |
release(Polygon polygon)
Releases a
Polygon instance back to the pool |
void |
release(Rectangle rectangle)
Releases a
Rectangle instance back to the pool |
void |
release(RegularHexagon regularHexagon)
Releases a
RegularHexagon instance back to the pool |
void |
release(RegularPentagon regularPentagon)
Releases a
RegularPentagon instance back to the pool |
void |
release(Triangle triangle)
Releases a
Triangle instance back to the pool |
Triangle |
triangle(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Allocates a
Triangle from the pool |
public static int DEFAULT_POOL_SIZE
public void init()
public void release(Circle circle)
Circle instance back to the poolcircle - The Circle instancepublic EquilateralTriangle equilateralTriangle()
EquilateralTriangle from the poolEquilateralTriangle instancepublic void release(EquilateralTriangle equilateralTriangle)
EquilateralTriangle instance back to the poolequilateralTriangle - The EquilateralTriangle instancepublic void release(Line line)
Line instance back to the poolline - The Line instancepublic LineSegment lineSegment()
LineSegment from the poolLineSegment instancepublic void release(LineSegment lineSegment)
LineSegment instance back to the poollineSegment - The LineSegment instancepublic void release(Point point)
Point instance back to the poolpoint - The Point instancepublic Polygon polygon(float[] vertices)
Polygon from the poolvertices - The vertices to setPolygon instancepublic void release(Polygon polygon)
Polygon instance back to the poolpolygon - The Polygon instancepublic Rectangle rectangle()
Rectangle from the poolRectangle instancepublic void release(Rectangle rectangle)
Rectangle instance back to the poolrectangle - The Rectangle instancepublic RegularHexagon regularHexagon()
RegularHexagon from the poolRegularHexagon instancepublic void release(RegularHexagon regularHexagon)
RegularHexagon instance back to the poolregularHexagon - The RegularHexagon instancepublic RegularPentagon regularPentagon()
RegularPentagon from the poolRegularPentagon instancepublic void release(RegularPentagon regularPentagon)
RegularPentagon instance back to the poolregularPentagon - The RegularPentagon instancepublic Triangle triangle(float x1, float y1, float x2, float y2, float x3, float y3)
Triangle from the poolTriangle instancepublic void release(Triangle triangle)
Triangle instance back to the pooltriangle - The Triangle instancepublic int getTotalCirclesAvailable()
Circle instances currently in the poolpublic int getTotalEquilateralTrianglesAvailable()
EquilateralTriangle instances currently in the poolEquilateralTriangle instances excluding EquilateralTriangle instances already allocatedpublic int getTotalLinesAvailable()
Line instances currently in the poolLine instances already allocatedpublic int getTotalLineSegmentsAvailable()
LineSegment instances currently in the poolLineSegment instances excluding LineSegment instances already allocatedpublic int getTotalPointsAvailable()
Point instances currently in the poolpublic int getTotalPolygonsAvailable()
Polygon instances currently in the poolpublic int getTotalRectanglesAvailable()
Rectangle instances currently in the poolpublic int getTotalRegularHexagonsAvailable()
RegularHexagon instances currently in the poolRegularHexagon instances excluding RegularHexagon instances already allocatedpublic int getTotalRegularPentagonsAvailable()
RegularPentagon instances currently in the poolRegularPentagon instances excluding RegularPentagon instances already allocated