Class Annotation<T extends com.mapbox.geojson.Geometry>

  • Direct Known Subclasses:
    Circle, Fill, Line, Symbol

    public abstract class Annotation<T extends com.mapbox.geojson.Geometry>
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T geometry  
      protected com.google.gson.JsonObject jsonObject  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      com.google.gson.JsonElement getData()
      Get the arbitrary json object data of the annotation.
      T getGeometry()
      Get the geometry of an annotation, type of geometry returned depends on the generic attribute.
      long getId()
      Returns this annotation's internal ID.
      int hashCode()  
      boolean isDraggable()
      Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.
      void setData​(com.google.gson.JsonElement jsonElement)
      Set the arbitrary json data of the annotation.
      void setDraggable​(boolean draggable)
      Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.
      void setGeometry​(T geometry)
      Set the geometry of an annotation, geometry type depends on the generic attribute.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • jsonObject

        protected com.google.gson.JsonObject jsonObject
      • geometry

        protected T extends com.mapbox.geojson.Geometry geometry
    • Method Detail

      • setGeometry

        public void setGeometry​(T geometry)
        Set the geometry of an annotation, geometry type depends on the generic attribute.
        Parameters:
        geometry - an instance of a geometry type
      • getGeometry

        public T getGeometry()
        Get the geometry of an annotation, type of geometry returned depends on the generic attribute.
        Returns:
        the geometry of the annotation
        Throws:
        java.lang.IllegalStateException - if geometry hasn't been initialised
      • getId

        public long getId()
        Returns this annotation's internal ID.
        Returns:
        annotation's internal ID
      • isDraggable

        public boolean isDraggable()
        Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.
        Returns:
        draggable when touched
      • setDraggable

        public void setDraggable​(boolean draggable)
        Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.
        Parameters:
        draggable - should be draggable
      • setData

        public void setData​(@Nullable
                            com.google.gson.JsonElement jsonElement)
        Set the arbitrary json data of the annotation.
        Parameters:
        jsonElement - the arbitrary json object data
      • getData

        @Nullable
        public com.google.gson.JsonElement getData()
        Get the arbitrary json object data of the annotation.
        Returns:
        the arbitrary json object data if set, else null
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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