Class MapComposedElement.PointGroup

    • Field Detail

      • partIndex

        protected final int partIndex
        is the index of this group.
    • Constructor Detail

      • PointGroup

        public PointGroup​(int index)
        Constructor.
        Parameters:
        index - the group index.
    • Method Detail

      • getGroupIndex

        @Pure
        public int getGroupIndex()
        Replies the gorup index.
        Returns:
        the index of this group
      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.
      • points

        @Pure
        public Iterable<Point2d> points()
        Replies the points that are composing this element.
        Returns:
        the points of this group.