Package com.impossibl.postgres.utils
Enum GeometryParsers
- java.lang.Object
-
- java.lang.Enum<GeometryParsers>
-
- com.impossibl.postgres.utils.GeometryParsers
-
- All Implemented Interfaces:
Serializable
,Comparable<GeometryParsers>
public enum GeometryParsers extends Enum<GeometryParsers>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String... args)
double[]
parseBox(CharSequence s)
Parses a box.double[]
parseCircle(CharSequence s)
Parses a circle.double[]
parseLine(CharSequence s)
Parses an infinite line represented by the linear equation Ax + By + C = 0.double[]
parseLSeg(CharSequence s)
Parses a lseg.Path
parsePath(CharSequence s)
Parses a path.double[]
parsePoint(CharSequence s)
Parses a point.double[][]
parsePolygon(CharSequence s)
Parses a polygon.static GeometryParsers
valueOf(String name)
Returns the enum constant of this type with the specified name.static GeometryParsers[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final GeometryParsers INSTANCE
-
-
Method Detail
-
values
public static GeometryParsers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GeometryParsers c : GeometryParsers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GeometryParsers valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
parsePath
public Path parsePath(CharSequence s)
Parses a path.[ ( x1 , y1 ) , ... , ( xn , yn ) ] ( ( x1 , y1 ) , ... , ( xn , yn ) ) ( x1 , y1 ) , ... , ( xn , yn ) ( x1 , y1 , ... , xn , yn ) x1 , y1 , ... , xn , yn
- Parameters:
s
- The path to parse.- Returns:
- A Path.
-
parsePolygon
public double[][] parsePolygon(CharSequence s)
Parses a polygon.( ( x1 , y1 ) , ... , ( xn , yn ) ) ( x1 , y1 ) , ... , ( xn , yn ) ( x1 , y1 , ... , xn , yn ) x1 , y1 , ... , xn , yn
- Parameters:
s
- The polygon to parse.- Returns:
- A list of points.
-
parseCircle
public double[] parseCircle(CharSequence s)
Parses a circle.< ( x , y ) , r > ( ( x , y ) , r ) ( x , y ) , r x , y , r
- Parameters:
s
- The circle to parse.- Returns:
- [p.x, p.y, r]: A 3 elements array where the first 2 doubles represents a center point and the last element the radius.
-
parsePoint
public double[] parsePoint(CharSequence s)
Parses a point.( x , y ) x , y
- Parameters:
s
- The point to parse.- Returns:
- [p.x, p.y]
-
parseBox
public double[] parseBox(CharSequence s)
Parses a box.( ( x1 , y1 ) , ( x2 , y2 ) ) ( x1 , y1 ) , ( x2 , y2 ) x1 , y1 , x2 , y2
- Parameters:
s
- The box to parse.- Returns:
- An array of size 4 (2 points.)
-
parseLSeg
public double[] parseLSeg(CharSequence s)
Parses a lseg.[ ( x1 , y1 ) , ( x2 , y2 ) ] ( ( x1 , y1 ) , ( x2 , y2 ) ) ( x1 , y1 ) , ( x2 , y2 ) x1 , y1 , x2 , y2
- Parameters:
s
- The lseg to parse.- Returns:
- An array of size 4 (2 points.)
-
parseLine
public double[] parseLine(CharSequence s)
Parses an infinite line represented by the linear equation Ax + By + C = 0.{ A, B, C } also accepted: [ ( x1 , y1 ) , ( x2 , y2 ) ] ( ( x1 , y1 ) , ( x2 , y2 ) ) ( x1 , y1 ) , ( x2 , y2 ) x1 , y1 , x2 , y2
- Parameters:
s
- The line to parse.- Returns:
- An array of size 3 ([A,B,C] --> Ax+By+C=0.)
-
main
public static void main(String... args)
-
-