public class Location3D extends Object
Constructor and Description |
---|
Location3D(double x,
double y,
double z)
Constructs a new
Location3D from the given coordinates. |
Location3D(String world,
double x,
double y,
double z)
Constructs a new
Location3D in the given world from the given
coordinates. |
Modifier and Type | Method and Description |
---|---|
static Location3D |
deserialize(String serial)
Deserializes the given string into a new
Location3D object. |
boolean |
equals(Object obj) |
Optional<String> |
getWorld()
Gets the world containing this
Location3D . |
double |
getX()
Gets the x-coordinate of this
Location3D . |
double |
getY()
Gets the y-coordinate of this
Location3D . |
double |
getZ()
Gets the z-coordinate of this
Location3D . |
int |
hashCode() |
String |
serialize()
Serializes this
Location3D to a string. |
public Location3D(String world, double x, double y, double z)
Location3D
in the given world from the given
coordinates.world
- The name of the world which contains this Location3D
x
- The x-coordinate of the new Location3D
y
- The y-coordinate of the new Location3D
z
- The z-coordinate of the new Location3D
public Location3D(double x, double y, double z)
Location3D
from the given coordinates.x
- The x-coordinate of the new Location3D
y
- The y-coordinate of the new Location3D
z
- The z-coordinate of the new Location3D
public Optional<String> getWorld()
Location3D
.Location3D
, or
Optional.absent()
if one is not definedpublic double getX()
Location3D
.Location3D
public double getY()
Location3D
.Location3D
public double getZ()
Location3D
.Location3D
public String serialize()
Location3D
to a string.Location3D
public static Location3D deserialize(String serial) throws IllegalArgumentException
Location3D
object.serial
- The string to deserializeLocation3D
objectIllegalArgumentException
- If the provided string is not a valid
serial for this class