public final class NdsRect
extends java.lang.Object
implements android.os.Parcelable
Rect
中的几何计算外使用方式基本相同限定符和类型 | 字段和说明 |
---|---|
int |
bottom |
static android.os.Parcelable.Creator<NdsRect> |
CREATOR |
int |
left |
int |
right |
int |
top |
构造器和说明 |
---|
NdsRect()
Create a new empty Rect.
|
NdsRect(int left,
int top,
int right,
int bottom)
Create a new rectangle with the specified coordinates.
|
NdsRect(NdsRect r)
Create a new rectangle, initialized with the values in the specified
rectangle (which is left unmodified).
|
限定符和类型 | 方法和说明 |
---|---|
NdsRect |
convertFromRect(android.graphics.Rect rect) |
android.graphics.Rect |
convertToRect() |
int |
describeContents()
Parcelable interface methods
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
flattenToString()
Return a string representation of the rectangle in a well-defined format.
|
int |
hashCode() |
void |
printShortString(java.io.PrintWriter pw)
Print short representation to given writer.
|
void |
readFromParcel(android.os.Parcel in)
Set the rectangle's coordinates from the data stored in the specified
parcel.
|
void |
set(int left,
int top,
int right,
int bottom)
Set the rectangle's coordinates to the specified values.
|
void |
set(NdsRect src)
Copy the coordinates from src into this rectangle.
|
java.lang.String |
toShortString()
Return a string representation of the rectangle in a compact form.
|
java.lang.String |
toShortString(java.lang.StringBuilder sb)
Return a string representation of the rectangle in a compact form.
|
java.lang.String |
toString() |
static NdsRect |
unflattenFromString(java.lang.String str)
Returns a Rect from a string of the form returned by
flattenToString() , or null if the string is not of that form. |
void |
writeToParcel(android.os.Parcel out,
int flags)
Write this rectangle to the specified parcel.
|
public int left
public int top
public int right
public int bottom
public static final android.os.Parcelable.Creator<NdsRect> CREATOR
public NdsRect()
public NdsRect(int left, int top, int right, int bottom)
left
- The X coordinate of the left side of the rectangletop
- The Y coordinate of the top of the rectangleright
- The X coordinate of the right side of the rectanglebottom
- The Y coordinate of the bottom of the rectanglepublic NdsRect(NdsRect r)
r
- The rectangle whose coordinates are copied into the new
rectangle.public NdsRect convertFromRect(android.graphics.Rect rect)
public android.graphics.Rect convertToRect()
public boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
public java.lang.String toString()
toString
在类中 java.lang.Object
public java.lang.String toShortString()
public java.lang.String toShortString(java.lang.StringBuilder sb)
public java.lang.String flattenToString()
You can later recover the Rect from this string through
unflattenFromString(String)
.
public static NdsRect unflattenFromString(java.lang.String str)
flattenToString()
, or null if the string is not of that form.public void printShortString(java.io.PrintWriter pw)
public void set(int left, int top, int right, int bottom)
left
- The X coordinate of the left side of the rectangletop
- The Y coordinate of the top of the rectangleright
- The X coordinate of the right side of the rectanglebottom
- The Y coordinate of the bottom of the rectanglepublic void set(NdsRect src)
src
- The rectangle whose coordinates are copied into this
rectangle.public int describeContents()
describeContents
在接口中 android.os.Parcelable
public void writeToParcel(android.os.Parcel out, int flags)
writeToParcel
在接口中 android.os.Parcelable
out
- The parcel to write the rectangle's coordinates intopublic void readFromParcel(android.os.Parcel in)
in
- The parcel to read the rectangle's coordinates from©Mapbar Engine Team;All Rights Reserved