Package org.deltava.util.tile
Class SingleTile
java.lang.Object
org.gvagroup.tile.AbstractTile
org.deltava.util.tile.SingleTile
- All Implemented Interfaces:
Serializable
,Comparable<org.gvagroup.tile.Tile>
,RasterTile
,org.gvagroup.tile.Tile
A single Tile.
- Since:
- 5.0
- Version:
- 7.2
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.gvagroup.tile.AbstractTile
_addr
Fields inherited from interface org.gvagroup.tile.Tile
HEIGHT, WIDTH
-
Constructor Summary
ConstructorDescriptionSingleTile
(org.gvagroup.tile.TileAddress addr) Creates a new blank Tile.SingleTile
(org.gvagroup.tile.TileAddress addr, BufferedImage img) Creates a new Tile. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()
Returns the Tile image.boolean
isEmpty()
Returns whether this Tile has any data.boolean
isEmpty
(org.gvagroup.tile.TileAddress addr) Returns whether a child of this Tile would be empty.void
setImage
(BufferedImage img) Sets the Tile image.Methods inherited from class org.gvagroup.tile.AbstractTile
compareTo, getAddress, getName, hashCode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.gvagroup.tile.Tile
getAddress, getName
-
Field Details
-
_img
-
-
Constructor Details
-
SingleTile
public SingleTile(org.gvagroup.tile.TileAddress addr) Creates a new blank Tile.- Parameters:
addr
- the address
-
SingleTile
Creates a new Tile.- Parameters:
addr
- the addressimg
- the BufferedImage
-
-
Method Details
-
setImage
Sets the Tile image.- Specified by:
setImage
in interfaceorg.gvagroup.tile.Tile
- Specified by:
setImage
in classorg.gvagroup.tile.AbstractTile
- Parameters:
img
- the Image- Throws:
IllegalArgumentException
- if the height and width are not equal to that of a single tile
-
getImage
Returns the Tile image.- Specified by:
getImage
in 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
public boolean isEmpty(org.gvagroup.tile.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 TileNullPointerException
- if addr is null
-