Class SearchPath


  • public class SearchPath
    extends HintAndMovement
    This is the path of the searcher in the plain searching the treasure, stored as a list of Points.
    • Constructor Detail

      • SearchPath

        public SearchPath​(org.locationtech.jts.geom.Point... points)
    • Method Detail

      • getFirstPoint

        public org.locationtech.jts.geom.Point getFirstPoint()
        Returns:
        the first points of the moves-sequence.
      • getLastPoint

        public org.locationtech.jts.geom.Point getLastPoint()
        Returns:
        the last end-position of the moves-sequence.
      • addPoint

        public void addPoint​(org.locationtech.jts.geom.Point point)
        Parameters:
        point - The next Point, visited in this movement.
      • addPointToFront

        public void addPointToFront​(org.locationtech.jts.geom.Point point)
        Parameters:
        point - the Point, the Searcher starts its movement from.
      • addAdditionalItem

        public void addAdditionalItem​(GeometryItem<?> geometryItem)
        Parameters:
        geometryItem - to add GeometryItem objects, which are only relevant for displaying
      • getPointsExceptTheFirst

        public java.util.List<GeometryItem<org.locationtech.jts.geom.Point>> getPointsExceptTheFirst()
        Returns:
        a list, containing every Point of this SearchPath, except the first. List could be empty.
        Throws:
        java.lang.IllegalStateException - if this SearchPath contains zero Points.
      • getLineGeometryItems

        public java.util.List<GeometryItem<org.locationtech.jts.geom.LineString>> getLineGeometryItems()
        Returns:
        A list of GeometryItems, each containing a LineString. This describes the movement of the Searcher.
        Throws:
        java.lang.IllegalStateException - if this searchPath contains zero Points.
      • getLines

        public java.util.List<org.locationtech.jts.geom.LineString> getLines()
        Returns:
        A list of LineString, describing the movement of the Searcher.
        Throws:
        java.lang.IllegalStateException - if this searchPath contains zero Points.
      • getLength

        public double getLength()
        Returns:
        the distance, of this searchPath.
      • getPoints

        public java.util.List<org.locationtech.jts.geom.Point> getPoints()
        The list of points representing the searching path of the corresponding searcher.
      • setPoints

        public void setPoints​(java.util.List<org.locationtech.jts.geom.Point> points)
        The list of points representing the searching path of the corresponding searcher.
      • getAdditional

        public java.util.List<GeometryItem<?>> getAdditional()
        The list of additional items which should be displayed with this SearchPath.