Package globus.glmap

Class MapPointSet

java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.MapPointSet

@ParametersAreNonnullByDefault
public class MapPointSet
extends GLNativeObject
MapPointSet handles operations on set of points. Useful to find nearest point in map coordinates or check if point already exists
  • Constructor Summary

    Constructors
    Constructor Description
    MapPointSet()
    Default constructor.
  • Method Summary

    Modifier and Type Method Description
    boolean contains​(MapPoint point)
    Checks if point with given coordinates exists in set.
    void insert​(MapPoint point)
    Inserts new point to set.
    boolean insertUnique​(MapPoint point)
    Inserts new point to set.
    MapPoint nearest​(MapPoint point)
    Returns nearest point in set

    Methods inherited from class globus.glmap.GLNativeObject

    dispose

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapPointSet

      public MapPointSet()
      Default constructor. Creates empty set.
  • Method Details

    • insert

      public void insert​(MapPoint point)
      Inserts new point to set. Use this function if many points with same coordinates can be in set
      Parameters:
      point - Point to insert.
    • insertUnique

      public boolean insertUnique​(MapPoint point)
      Inserts new point to set.
      Parameters:
      point - point to insert.
      Returns:
      true if point is inserted. false if point with same coordinates already in set.
    • contains

      public boolean contains​(MapPoint point)
      Checks if point with given coordinates exists in set.
      Parameters:
      point - point to insert.
      Returns:
      true if point with given coordinates is in set
    • nearest

      @Nullable public MapPoint nearest​(MapPoint point)
      Returns nearest point in set
      Parameters:
      point - reference point to calculate distance
      Returns:
      Nearest point in set