Class PositionList

    • Constructor Detail

      • PositionList

        public PositionList()
        Creates a new empty instance of PositionList
    • Method Detail

      • size

        public int size()
        Returns:
        the number of positions in the list
      • getLongitude

        public double getLongitude​(int pos)
        Parameters:
        pos - position index
        Returns:
        longitude for position
      • getLatitude

        public double getLatitude​(int pos)
        Parameters:
        pos - position index
        Returns:
        latitude for position
      • add

        public void add​(double latitude,
                        double longitude)
        Add a position at the end of the list
      • insert

        public void insert​(int pos,
                           double latitude,
                           double longitude)
        Add a position at a given index in the list. The rest of the list is shifted one place to the "right"
        Parameters:
        pos - position index
      • replace

        public void replace​(int pos,
                            double latitude,
                            double longitude)
        Replace the position at the index with new values
        Parameters:
        pos - position index
      • remove

        public void remove​(int pos)
        Remove the position at the index, the rest of the list is shifted one place to the "left"
        Parameters:
        pos - position index