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 |
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
instance