public class Region extends Dimension implements Comparable<Dimension>
Represents a region to use when need to specify a sprite.
Constructor and Description |
---|
Region(int x,
int y,
Dimension d)
Builds a new region.
|
Region(int x,
int y,
int w,
int h)
Builds a new region.
|
Region(Region other)
Builds a region with the area represented by the given region.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Dimension other)
Compares this region to another dimension.
|
boolean |
equals(Object other) |
int |
getxPosition()
Gets the x position.
|
int |
getyPosition()
Gets the y position.
|
int |
hashCode() |
getHeight, getSize, getWidth, setSize, setSize, setSize, toString
clone, setSize
public Region(int x, int y, int w, int h)
Builds a new region.
x
- the x positiony
- the y positionw
- the widthh
- the heightpublic Region(int x, int y, Dimension d)
Builds a new region.
x
- the x positiony
- the y positiond
- the region's dimensionspublic Region(Region other)
Builds a region with the area represented by the given region.
other
- the given regionpublic int getxPosition()
Gets the x position.
public int getyPosition()
Gets the y position.
public int compareTo(Dimension other)
Compares this region to another dimension.
This region is bigger than the compared dimension if and only if its width AND its height are bigger than the other one.
compareTo
in interface Comparable<Dimension>
other
- the other dimensionCopyright © 2012-2015. All Rights Reserved.