Class SingleTile

java.lang.Object
org.deltava.util.tile.AbstractTile
org.deltava.util.tile.SingleTile
All Implemented Interfaces:
Serializable, Comparable<Tile>, RasterTile, Tile

public class SingleTile extends AbstractTile implements RasterTile
A single Tile.
Since:
5.0
Version:
11.3
Author:
Luke
See Also:
  • Field Details

  • Constructor Details

    • SingleTile

      public SingleTile(TileAddress addr)
      Creates a new blank Tile.
      Parameters:
      addr - the address
    • SingleTile

      public SingleTile(TileAddress addr, BufferedImage img)
      Creates a new Tile.
      Parameters:
      addr - the address
      img - the BufferedImage
  • Method Details

    • setImage

      public void setImage(BufferedImage img)
      Description copied from interface: Tile
      Sets the tile image.
      Specified by:
      setImage in interface Tile
      Parameters:
      img - the rendered image
    • getImage

      public BufferedImage getImage()
      Description copied from interface: RasterTile
      Returns the rendered image.
      Specified by:
      getImage in interface RasterTile
      Returns:
      the image
    • isEmpty

      public boolean isEmpty()
      Returns whether this Tile has any data.
      Returns:
      TRUE if the Tile has no data, otherwise FALSE
    • isEmpty

      public boolean isEmpty(TileAddress addr)
      Returns whether a child of this Tile would be empty. This has the significant performance advantage since less data needs to be processed than if one generated the Tile and called isEmpty on it.
      Parameters:
      addr - the child Address
      Returns:
      FALSE if the Tile would be empty
      Throws:
      IllegalArgumentException - if addr's parent is not this Tile
      NullPointerException - if addr is null