Loading...
Searching...
No Matches
com.navigine.idl.java.Polygon Class Reference

A polygon with specified list of points. More...

Public Member Functions

 Polygon (ArrayList< Point > points)
 Default constructor for class Polygon.
 
ArrayList< PointgetPoints ()
 Ring specifying the area.
 
String toString ()
 

Detailed Description

A polygon with specified list of points.

Java code snippet:

// Create polygon
Polygon polygon = new Polygon(polygonPoints);
System.out.println("Created polygon with " + polygon.getPoints().size() + " points");

Kotlin code snippet:

// Create polygon
val polygon = Polygon(polygonPoints)
println("Created polygon with ${polygon.points.size} points")

Definition at line 24 of file Polygon.java.

Constructor & Destructor Documentation

◆ Polygon()

com.navigine.idl.java.Polygon.Polygon ( ArrayList< Point > points)
inline

Default constructor for class Polygon.

Definition at line 32 of file Polygon.java.

Member Function Documentation

◆ getPoints()

ArrayList< Point > com.navigine.idl.java.Polygon.getPoints ( )
inline

Ring specifying the area.

Returns

Java code snippet:

// Get polygon points
List<Point> points = polygon.getPoints();
System.out.println("Polygon points: " + points.stream()
.map(p -> "(" + p.getX() + ", " + p.getY() + ")")
.reduce("", (a, b) -> a + (a.isEmpty() ? "" : ", ") + b));

Kotlin code snippet:

// Get polygon points
val points = polygon.points
println("Polygon points: ${points.joinToString(", ") { "(${it.x}, ${it.y})" }}")

Definition at line 49 of file Polygon.java.

◆ toString()

String com.navigine.idl.java.Polygon.toString ( )
inline

Definition at line 54 of file Polygon.java.


The documentation for this class was generated from the following file: