public class Insets extends Object
Insets are immutable so may be treated as values.
Modifier and Type | Field and Description |
---|---|
int |
bottom |
int |
left |
static Insets |
NONE |
int |
right |
int |
top |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Two Insets instances are equal iff they belong to the same class and their fields are
pairwise equal.
|
int |
hashCode()
Returns an integer hash code for this object.
|
static Insets |
of(int left,
int top,
int right,
int bottom)
Return an Insets instance with the appropriate values.
|
static Insets |
of(Rect r)
Return an Insets instance with the appropriate values.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
public static final Insets NONE
public final int left
public final int top
public final int right
public final int bottom
public static Insets of(int left, int top, int right, int bottom)
left
- the left insettop
- the top insetright
- the right insetbottom
- the bottom insetpublic static Insets of(Rect r)
r
- the rectangle from which to take the valuespublic boolean equals(Object o)
equals
in class Object
o
- the object to compare this instance with.o
Object.hashCode()
public int hashCode()
Object
Object.equals(java.lang.Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
hashCode
in class Object
Object.equals(java.lang.Object)
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.