Class Path

  • All Implemented Interfaces:
    java.lang.Iterable<CoordinateIfc>

    public class Path
    extends java.lang.Object
    implements java.lang.Iterable<CoordinateIfc>
    • Method Detail

      • getOrigin

        public final CoordinateIfc getOrigin()
        The coordinate of the origin of the path
        Returns:
      • setOrigin

        public final void setOrigin​(CoordinateIfc origin)
        Sets the origin associated with the path
        Parameters:
        origin -
      • getTotalDistance

        public final double getTotalDistance()
        Gets the total distance associated with linear pt. to pt. travel on the path
        Returns:
        Returns the totalDistance.
      • add

        public boolean add​(CoordinateIfc point)
        Adds a point to the path. The origin is not on the path. The method setOrigin() must be called prior to adding any points to the path; otherwise an IllegalArgumentException will be thrown.
        Parameters:
        point -
        Returns:
      • clear

        public final void clear()
        Clears the underlying list, sets the origin to null and resets the length of the path to zero
      • contains

        public boolean contains​(CoordinateIfc arg0)
        Checks if the given Vector2D is in the path
        Parameters:
        arg0 -
        Returns:
      • isEmpty

        public final boolean isEmpty()
        Checks whether the path is empty
        Returns:
      • iterator

        public final java.util.Iterator<CoordinateIfc> iterator()
        Returns an iterator over the path
        Specified by:
        iterator in interface java.lang.Iterable<CoordinateIfc>
        Returns:
      • listIterator

        public final java.util.ListIterator<CoordinateIfc> listIterator()
        Returns a ListIterator over the path
        Returns:
      • size

        public final int size()
        The number of points in the path.
        Returns:
      • toArray

        public final CoordinateIfc[] toArray​(CoordinateIfc[] arg0)
        Converts the paths to an array
        Parameters:
        arg0 -
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object