Margins.java revision 3db9393ba06bbf70fa7b4a6db1ef60396979a1d4
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.eclipse.org/org/documents/epl-v10.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.ide.common.api;
18
19import com.google.common.annotations.Beta;
20
21/**
22 * Set of margins - distances to outer left, top, right and bottom edges. These objects
23 * can be used for both actual <b>margins</b> as well as insets - and in general any
24 * deltas to the bounds of a rectangle.
25 * <p>
26 * <b>NOTE: This is not a public or final API; if you rely on this be prepared
27 * to adjust your code for the next tools release.</b>
28 */
29@Beta
30public class Margins {
31    /** The left margin */
32    public final int left;
33
34    /** The right margin */
35    public final int right;
36
37    /** The top margin */
38    public final int top;
39
40    /** The bottom margin */
41    public final int bottom;
42
43    /**
44     * Creates a new {@link Margins} instance.
45     *
46     * @param left the left side margin
47     * @param right the right side margin
48     * @param top the top margin
49     * @param bottom the bottom margin
50     */
51    public Margins(int left, int right, int top, int bottom) {
52        super();
53        this.left = left;
54        this.right = right;
55        this.top = top;
56        this.bottom = bottom;
57    }
58
59    @Override
60    public String toString() {
61        return "Margins [left=" + left + ", right=" + right + ", top=" + top + ", bottom=" + bottom
62                + "]";
63    }
64}
65