1 package com.android.launcher3.util;
2 
3 /**
4  * Base class which represents an area on the grid.
5  */
6 public class CellAndSpan {
7 
8     /**
9      * Indicates the X position of the associated cell.
10      */
11     public int cellX = -1;
12 
13     /**
14      * Indicates the Y position of the associated cell.
15      */
16     public int cellY = -1;
17 
18     /**
19      * Indicates the X cell span.
20      */
21     public int spanX = 1;
22 
23     /**
24      * Indicates the Y cell span.
25      */
26     public int spanY = 1;
27 
CellAndSpan()28     public CellAndSpan() {
29     }
30 
copyFrom(CellAndSpan copy)31     public void copyFrom(CellAndSpan copy) {
32         cellX = copy.cellX;
33         cellY = copy.cellY;
34         spanX = copy.spanX;
35         spanY = copy.spanY;
36     }
37 
CellAndSpan(int cellX, int cellY, int spanX, int spanY)38     public CellAndSpan(int cellX, int cellY, int spanX, int spanY) {
39         this.cellX = cellX;
40         this.cellY = cellY;
41         this.spanX = spanX;
42         this.spanY = spanY;
43     }
44 
toString()45     public String toString() {
46         return "(" + cellX + ", " + cellY + ": " + spanX + ", " + spanY + ")";
47     }
48 }
49