Insetspublic class Insets extends Object An Insets instance holds four integer offsets which describe changes to the four
edges of a Rectangle. By convention, positive values move edges towards the
centre of the rectangle.
Insets are immutable so may be treated as values. |
Fields Summary |
---|
public static final Insets | NONE | public final int | left | public final int | top | public final int | right | public final int | bottom |
Constructors Summary |
---|
private Insets(int left, int top, int right, int bottom)
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object o)Two Insets instances are equal iff they belong to the same class and their fields are
pairwise equal.
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Insets insets = (Insets) o;
if (bottom != insets.bottom) return false;
if (left != insets.left) return false;
if (right != insets.right) return false;
if (top != insets.top) return false;
return true;
| public int | hashCode()
int result = left;
result = 31 * result + top;
result = 31 * result + right;
result = 31 * result + bottom;
return result;
| public static android.graphics.Insets | of(int left, int top, int right, int bottom)Return an Insets instance with the appropriate values.
if (left == 0 && top == 0 && right == 0 && bottom == 0) {
return NONE;
}
return new Insets(left, top, right, bottom);
| public static android.graphics.Insets | of(Rect r)Return an Insets instance with the appropriate values.
return (r == null) ? NONE : of(r.left, r.top, r.right, r.bottom);
| public java.lang.String | toString()
return "Insets{" +
"left=" + left +
", top=" + top +
", right=" + right +
", bottom=" + bottom +
'}";
|
|