Home | History | Annotate | Download | only in api
      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 
     17 package com.android.ide.common.api;
     18 
     19 import com.google.common.annotations.Beta;
     20 import com.android.annotations.NonNull;
     21 
     22 /**
     23  * Set of margins - distances to outer left, top, right and bottom edges. These objects
     24  * can be used for both actual <b>margins</b> as well as insets - and in general any
     25  * deltas to the bounds of a rectangle.
     26  * <p>
     27  * <b>NOTE: This is not a public or final API; if you rely on this be prepared
     28  * to adjust your code for the next tools release.</b>
     29  */
     30 @Beta
     31 public class Margins {
     32     /** The left margin */
     33     public final int left;
     34 
     35     /** The right margin */
     36     public final int right;
     37 
     38     /** The top margin */
     39     public final int top;
     40 
     41     /** The bottom margin */
     42     public final int bottom;
     43 
     44     /**
     45      * Creates a new {@link Margins} instance.
     46      *
     47      * @param left the left side margin
     48      * @param right the right side margin
     49      * @param top the top margin
     50      * @param bottom the bottom margin
     51      */
     52     public Margins(int left, int right, int top, int bottom) {
     53         super();
     54         this.left = left;
     55         this.right = right;
     56         this.top = top;
     57         this.bottom = bottom;
     58     }
     59 
     60     @NonNull
     61     @Override
     62     public String toString() {
     63         return "Margins [left=" + left + ", right=" + right + ", top=" + top + ", bottom=" + bottom
     64                 + "]";
     65     }
     66 }
     67