Class MapTile

java.lang.Object
com.massifmaps.core.MapTile

public class MapTile extends Object
An immutable map tile, used by tile layers for representing small pieces of map at different zoom levels and coordinates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an empty MapTile object.
    MapTile(int x, int y, int zoom, int frameNr)
    Constructs a MapTile object based on coordinates, zoom level and frame number.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    int
    Returns the time of this map tile.
    long
    Returns the internal tile id of this map tile.
    int
    Returns the x coordinate of this map tile.
    int
    Returns the y coordinate of this map tile.
    int
    Returns the zoom level of this map tile.
    int
    Returns the hash value of this object.
    Creates a string representation of this map tile, useful for logging.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MapTile

      public MapTile()
      Constructs an empty MapTile object.
    • MapTile

      public MapTile(int x, int y, int zoom, int frameNr)
      Constructs a MapTile object based on coordinates, zoom level and frame number.
      Parameters:
      x - The x coordinate of the tile.
      y - The y coordinate of the tile.
      zoom - The zoom level of the tile.
      frameNr - The frame number of the tile.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getX

      public int getX()
      Returns the x coordinate of this map tile.
      Returns:
      The x coordinate of this map tile.
    • getY

      public int getY()
      Returns the y coordinate of this map tile.
      Returns:
      The y coordinate of this map tile.
    • getZoom

      public int getZoom()
      Returns the zoom level of this map tile.
      Returns:
      The zoom level of this map tile.
    • getFrameNr

      public int getFrameNr()
      Returns the time of this map tile.
      Returns:
      The time of this map tile.
    • getTileId

      public long getTileId()
      Returns the internal tile id of this map tile.
      Returns:
      The internal tile id of this map tile.
    • toString

      public String toString()
      Creates a string representation of this map tile, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this map tile.