public class LocationImpl extends java.lang.Object implements IAdvancedLocation
Constructor and Description |
---|
LocationImpl(ILocation location) |
LocationImpl(int x,
int y) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
ILocation |
getLocationCopy() |
int |
getX()
Gets the x value.
|
int |
getY()
Gets the y value.
|
int |
hashCode() |
void |
scale(double amount)
Changes the current location.
|
ILocation |
setLocation(ILocation location)
Sets the location.
|
ILocation |
setLocation(int x,
int y)
Sets the location.
|
void |
setX(int x)
Sets the x coordinate of this location.
|
void |
setY(int y)
Sets the y coordinate of this location.
|
java.lang.String |
toString() |
ILocation |
translate(int dx,
int dy)
Translates the current location.
|
public LocationImpl(int x, int y)
public LocationImpl(ILocation location)
public int getX()
ILocation
public int getY()
ILocation
public void setX(int x)
ILocation
public void setY(int y)
ILocation
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public ILocation getLocationCopy()
getLocationCopy
in interface IAdvancedLocation
public ILocation setLocation(int x, int y)
IAdvancedLocation
setLocation
in interface IAdvancedLocation
x
- the new x coordinate of the locationy
- the new y coordinate of the locationpublic ILocation setLocation(ILocation location)
IAdvancedLocation
setLocation
in interface IAdvancedLocation
location
- the location which contains the new x and y coordinatespublic void scale(double amount)
IAdvancedLocation
scale
in interface IAdvancedLocation
amount
- x and y coordinate of the location will be multiplied with
this amountpublic ILocation translate(int dx, int dy)
IAdvancedLocation
translate
in interface IAdvancedLocation
dx
- this value will be added to the x coordinatedy
- this value will be added to the y coordinate