Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.mapelement
Class MapComposedElement.PointGroup
- java.lang.Object
-
- org.arakhne.afc.gis.mapelement.MapComposedElement.PointGroup
-
- All Implemented Interfaces:
Comparable<MapComposedElement.PointGroup>,Iterable<Point2d>
- Enclosing class:
- MapComposedElement
public final class MapComposedElement.PointGroup extends Object implements Comparable<MapComposedElement.PointGroup>, Iterable<Point2d>
This class represents a group of points inside a composed MapElement.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Olivier LAMOTTE, Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Field Summary
Fields Modifier and Type Field Description protected intpartIndexis the index of this group.
-
Constructor Summary
Constructors Constructor Description PointGroup(int index)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double x, double y)Add a point at the end of this part.voidadd(double x, double y, int index)Insert a point at the specified index.voidadd(Point2d point)Add a point at the end of this part.voidadd(Point2D<?,?> point, int index)Insert a point at the specified index.intcompareTo(MapComposedElement.PointGroup group)booleanequals(Object obj)Point2dget(int index)Replies the point at the specified index.intgetGroupIndex()Replies the gorup index.intgetMany(int index, Point2D<?,?>... points)Replies the points from the specified index.inthashCode()Iterator<Point2d>iterator()Iterable<Point2d>points()Replies the points that are composing this element.Point2dremoveAt(int index)Remove the point at the specified index.voidset(int index, double x, double y)Set the point at the specified index.voidset(int index, Point2D<?,?> point)Set the point at the specified index.intsize()Replies the count of points.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
compareTo
@Pure public int compareTo(MapComposedElement.PointGroup group)
- Specified by:
compareToin interfaceComparable<MapComposedElement.PointGroup>
-
getGroupIndex
@Pure public int getGroupIndex()
Replies the gorup index.- Returns:
- the index of this group
-
add
public void add(Point2d point)
Add a point at the end of this part.- Parameters:
point- the new point.
-
add
public void add(double x, double y)Add a point at the end of this part.- Parameters:
x- x coordinate.y- y coordinate.
-
add
public void add(Point2D<?,?> point, int index)
Insert a point at the specified index.- Parameters:
point- the new point.index- the insertion index.- Throws:
IndexOutOfBoundsException- in case of error.
-
add
public void add(double x, double y, int index)Insert a point at the specified index.- Parameters:
x- x coordinate.y- y coordinate.index- the insertion index.- Throws:
IndexOutOfBoundsException- in case of error.
-
removeAt
public Point2d removeAt(int index)
Remove the point at the specified index.- Parameters:
index- the index.- Returns:
- the removed point.
- Throws:
IndexOutOfBoundsException- in case of error.
-
size
@Pure public int size()
Replies the count of points.- Returns:
- the count of points.
-
get
@Pure public Point2d get(int index)
Replies the point at the specified index.- Parameters:
index- the index.- Returns:
- the point
- Throws:
IndexOutOfBoundsException- in case of error.
-
getMany
@Pure public int getMany(int index, Point2D<?,?>... points)Replies the points from the specified index. Fill the specified array of points with the point's coordinates starting from the specified ponit index.Thus function does not create the Point2D instances, the function
Tuple2d.set(double[])is used instead.- Parameters:
index- is the index of the first point to reply.points- is the list of points to fill.- Returns:
- the count of elements set.
- Throws:
IndexOutOfBoundsException- in case of error.
-
set
public void set(int index, double x, double y)Set the point at the specified index.- Parameters:
index- the index.x- x coordinate.y- y coordinate.- Throws:
IndexOutOfBoundsException- in case of error.
-
set
public void set(int index, Point2D<?,?> point)Set the point at the specified index.- Parameters:
index- the index.point- the point coordinates.- Throws:
IndexOutOfBoundsException- in case of error.
-
-