public class Box extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INDEX_H
The index of the height within the geometry array.
|
static int |
INDEX_W
The index of the width within the geometry array.
|
static int |
INDEX_X
The index of the X coordinate within the geometry array.
|
static int |
INDEX_Y
The index of the Y coordinate within the geometry array.
|
Constructor and Description |
---|
Box(int x,
int y,
int w,
int h)
Creates a box with the specified geometry.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
int[] |
getGeometry()
Returns an array containing the coordinates of this box.
|
boolean |
getGeometry(int[] geometry)
Fills an array containing the coordinates of this box.
|
int |
getHeight()
Returns the box's height in pixels.
|
long |
getNativeBox()
Returns a pointer to the native Box object.
|
Rect |
getRect()
Returns an
Rect containing the coordinates
of this box. |
int |
getWidth()
Returns the box's width in pixels.
|
int |
getX()
Returns the box's x-coordinate in pixels.
|
int |
getY()
Returns the box's y-coordinate in pixels.
|
void |
recycle()
Releases resources and frees any memory associated with this Box.
|
public static final int INDEX_X
public static final int INDEX_Y
public static final int INDEX_W
public static final int INDEX_H
public Box(int x, int y, int w, int h)
x
- X-coordinate of the top-left corner of the box.y
- Y-coordinate of the top-left corner of the box.w
- Width of the box.h
- Height of the box.public long getNativeBox()
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public Rect getRect()
Rect
containing the coordinates
of this box.public int[] getGeometry()
public boolean getGeometry(int[] geometry)
geometry
- A 4+ element integer array to fill with coordinates.true
on successpublic void recycle()