FileDocCategorySizeDatePackage
Point.javaAPI DocAndroid 5.1 API3446Thu Mar 12 22:22:30 GMT 2015android.graphics

Point

public class Point extends Object implements android.os.Parcelable
Point holds two integer coordinates

Fields Summary
public int
x
public int
y
public static final Parcelable.Creator
CREATOR
Constructors Summary
public Point()

public Point(int x, int y)

        this.x = x;
        this.y = y;
    
public Point(Point src)

        this.x = src.x;
        this.y = src.y;
    
Methods Summary
public intdescribeContents()
Parcelable interface methods

        return 0;
    
public final booleanequals(int x, int y)
Returns true if the point's coordinates equal (x,y)

        return this.x == x && this.y == y;
    
public booleanequals(java.lang.Object o)

        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Point point = (Point) o;

        if (x != point.x) return false;
        if (y != point.y) return false;

        return true;
    
public inthashCode()

        int result = x;
        result = 31 * result + y;
        return result;
    
public final voidnegate()
Negate the point's coordinates

        x = -x;
        y = -y;
    
public final voidoffset(int dx, int dy)
Offset the point's coordinates by dx, dy

        x += dx;
        y += dy;
    
public voidreadFromParcel(android.os.Parcel in)
Set the point's coordinates from the data stored in the specified parcel. To write a point to a parcel, call writeToParcel().

param
in The parcel to read the point's coordinates from


                                        
        
        x = in.readInt();
        y = in.readInt();
    
public voidset(int x, int y)
Set the point's x and y coordinates

        this.x = x;
        this.y = y;
    
public java.lang.StringtoString()

        return "Point(" + x + ", " + y + ")";
    
public voidwriteToParcel(android.os.Parcel out, int flags)
Write this point to the specified parcel. To restore a point from a parcel, use readFromParcel()

param
out The parcel to write the point's coordinates into

        out.writeInt(x);
        out.writeInt(y);