public class Coord
extends java.lang.Object
Constructor and Description |
---|
Coord()
Constructs a coordinate with x = y = 0.
|
Coord(int x,
int y)
Constructs a coordinate with the given x, y.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Returns true if the coordinates of this Coord and the given one are the same
|
int |
hashCode()
Returns the hashcode: x<<16 | y
|
int |
height()
return's y.
|
java.lang.String |
toString() |
void |
translate(int dx,
int dy)
Translates the current coordinate making x += dx and y += dy
|
int |
width()
return's x.
|
public Coord()
public Coord(int x, int y)
public void translate(int dx, int dy)
public int width()
public int height()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object