public class Region extends Object
| Constructor and Description |
|---|
Region(int left,
int top,
int width,
int height) |
Region(Location location,
RectangleSize size) |
Region(Region other) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Location location)
Check if a specified location is contained within this region.
|
boolean |
contains(Region other)
Check if a region is contained within the current region.
|
boolean |
equals(Object obj) |
int |
getHeight() |
int |
getLeft() |
Location |
getLocation() |
Location |
getMiddleOffset() |
List<Region> |
getSubRegions(RectangleSize maxSubRegionSize) |
int |
getTop() |
int |
getWidth() |
int |
hashCode() |
void |
intersect(Region other)
Replaces this region with the intersection of itself and
other |
boolean |
isEmpty() |
boolean |
isIntersected(Region other)
Check if a region is intersected with the current region.
|
protected void |
makeEmpty() |
void |
setLocation(Location location)
Set the (top,left) position of the current region
|
String |
toString() |
public static final Region EMPTY
public Region(int left,
int top,
int width,
int height)
public Region(Location location, RectangleSize size)
public Region(Region other)
protected void makeEmpty()
public boolean isEmpty()
public Location getLocation()
public void setLocation(Location location)
location - The (top,left) position to set.public List<Region> getSubRegions(RectangleSize maxSubRegionSize)
maxSubRegionSize - The maximum size of each sub-region (some
regions might be smaller).public boolean contains(Region other)
other - The region to check if it is contained within the current
region.other is contained within the current region,
false otherwise.public boolean contains(Location location)
location - The location to test.public boolean isIntersected(Region other)
other - The region to check intersection with.public void intersect(Region other)
otherother - The region with which to intersect.public int getLeft()
public int getTop()
public int getWidth()
public int getHeight()
public Location getMiddleOffset()
Copyright © 2014. All rights reserved.