Class SingleTile
java.lang.Object
org.deltava.util.tile.AbstractTile
org.deltava.util.tile.SingleTile
- All Implemented Interfaces:
Serializable, Comparable<Tile>, RasterTile, Tile
A single Tile.
- Since:
- 5.0
- Version:
- 11.3
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractTile
_addr -
Constructor Summary
ConstructorsConstructorDescriptionSingleTile(TileAddress addr) Creates a new blank Tile.SingleTile(TileAddress addr, BufferedImage img) Creates a new Tile. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Returns the rendered image.booleanisEmpty()Returns whether this Tile has any data.booleanisEmpty(TileAddress addr) Returns whether a child of this Tile would be empty.voidsetImage(BufferedImage img) Sets the tile image.Methods inherited from class AbstractTile
compareTo, getAddress, getName, hashCodeMethods inherited from class Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparable
compareToMethods inherited from interface Tile
getAddress, getName
-
Field Details
-
_img
-
-
Constructor Details
-
SingleTile
-
SingleTile
Creates a new Tile.- Parameters:
addr- the addressimg- the BufferedImage
-
-
Method Details
-
setImage
Description copied from interface:TileSets the tile image. -
getImage
Description copied from interface:RasterTileReturns the rendered image.- Specified by:
getImagein interfaceRasterTile- 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
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 TileNullPointerException- if addr is null
-