public class Location3D
extends java.lang.Object
Constructor and Description |
---|
Location3D(double x,
double y,
double z)
Constructs a new
Location3D from the given coordinates. |
Location3D(java.lang.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(java.lang.String serial)
Deserializes the given string into a new
Location3D object. |
boolean |
equals(java.lang.Object obj) |
com.google.common.base.Optional<java.lang.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() |
java.lang.String |
serialize()
Serializes this
Location3D to a string. |
public Location3D(java.lang.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 com.google.common.base.Optional<java.lang.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 java.lang.String serialize()
Location3D
to a string.Location3D
public static Location3D deserialize(java.lang.String serial) throws java.lang.IllegalArgumentException
Location3D
object.serial
- The string to deserializeLocation3D
objectjava.lang.IllegalArgumentException
- If the provided string is not a valid
serial for this classpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object