Class SearchPath
- java.lang.Object
-
- com.treasure.hunt.strategy.geom.HintAndMovement
-
- com.treasure.hunt.strategy.searcher.SearchPath
-
public class SearchPath extends HintAndMovement
This is the path of the searcher in the plain searching the treasure, stored as a list ofPoint
s.
-
-
Constructor Summary
Constructors Constructor Description SearchPath(org.locationtech.jts.geom.Point... points)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalItem(GeometryItem<?> geometryItem)
void
addPoint(org.locationtech.jts.geom.Point point)
void
addPointToFront(org.locationtech.jts.geom.Point point)
java.util.List<GeometryItem<?>>
getAdditional()
The list of additional items which should be displayed with this SearchPath.org.locationtech.jts.geom.Point
getFirstPoint()
org.locationtech.jts.geom.Point
getLastPoint()
double
getLength()
java.util.List<GeometryItem<org.locationtech.jts.geom.LineString>>
getLineGeometryItems()
java.util.List<org.locationtech.jts.geom.LineString>
getLines()
java.util.List<org.locationtech.jts.geom.Point>
getPoints()
The list of points representing the searching path of the corresponding searcher.java.util.List<GeometryItem<org.locationtech.jts.geom.Point>>
getPointsExceptTheFirst()
void
setPoints(java.util.List<org.locationtech.jts.geom.Point> points)
The list of points representing the searching path of the corresponding searcher.-
Methods inherited from class com.treasure.hunt.strategy.geom.HintAndMovement
getStatusMessageItemsToBeAdded, getStatusMessageItemsToBeRemoved
-
-
-
-
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 nextPoint
, visited in this movement.
-
addPointToFront
public void addPointToFront(org.locationtech.jts.geom.Point point)
- Parameters:
point
- thePoint
, theSearcher
starts its movement from.
-
addAdditionalItem
public void addAdditionalItem(GeometryItem<?> geometryItem)
- Parameters:
geometryItem
- to addGeometryItem
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 zeroPoint
s.
-
getLineGeometryItems
public java.util.List<GeometryItem<org.locationtech.jts.geom.LineString>> getLineGeometryItems()
- Returns:
- A list of
GeometryItem
s, each containing aLineString
. This describes the movement of theSearcher
. - Throws:
java.lang.IllegalStateException
- if this searchPath contains zeroPoint
s.
-
getLines
public java.util.List<org.locationtech.jts.geom.LineString> getLines()
- Returns:
- A list of
LineString
, describing the movement of theSearcher
. - Throws:
java.lang.IllegalStateException
- if this searchPath contains zeroPoint
s.
-
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.
-
-