Class Coordinate3D

java.lang.Object
xyz.calcugames.levelz.coord.Coordinate3D
All Implemented Interfaces:
Comparable<Coordinate>, Coordinate

public final class Coordinate3D extends Object implements Coordinate
Represents a 3-Dimensional Coordinate.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Coordinate3D(double[] xyz)
    Constructs a 3D Coordinate.
    Coordinate3D(double x, double y, double z)
    Constructs a 3D Coordinate.
    Coordinate3D(int[] xyz)
    Constructs a 3D Coordinate.
    Coordinate3D(int x, int y, int z)
    Constructs a 3D Coordinate.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    static @NotNull Coordinate3D
    Parses a 3D Coordinate from a string.
    Gets the dimension of the Coordinate.
    double
    Gets the magnitude of the Coordinate.
    double
    Gets the X Value of the Coordinate.
    double
    Gets the Y Value of the Coordinate.
    double
    Gets the Z Value of the Coordinate.
    int
     
    void
    setX(double x)
    Sets the X Value of the Coordinate.
    void
    setY(double y)
    Sets the Y Value of the Coordinate.
    void
    setZ(double z)
    Sets the Z Value of the Coordinate.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface xyz.calcugames.levelz.coord.Coordinate

    compareTo
  • Constructor Details

    • Coordinate3D

      public Coordinate3D(int x, int y, int z)
      Constructs a 3D Coordinate.
      Parameters:
      x - X Value
      y - Y Value
      z - Z Value
    • Coordinate3D

      public Coordinate3D(int[] xyz)
      Constructs a 3D Coordinate.
      Parameters:
      xyz - Array of X, Y, and Z Values
    • Coordinate3D

      public Coordinate3D(double x, double y, double z)
      Constructs a 3D Coordinate.
      Parameters:
      x - X Value
      y - Y Value
      z - Z Value
    • Coordinate3D

      public Coordinate3D(double[] xyz)
      Constructs a 3D Coordinate.
      Parameters:
      xyz - Array of X, Y, and Z Values
  • Method Details

    • getX

      public double getX()
      Gets the X Value of the Coordinate.
      Returns:
      X Value
    • setX

      public void setX(double x)
      Sets the X Value of the Coordinate.
      Parameters:
      x - X Value
    • getY

      public double getY()
      Gets the Y Value of the Coordinate.
      Returns:
      Y Value
    • setY

      public void setY(double y)
      Sets the Y Value of the Coordinate.
      Parameters:
      y - Y Value
    • getZ

      public double getZ()
      Gets the Z Value of the Coordinate.
      Returns:
      Z Value
    • setZ

      public void setZ(double z)
      Sets the Z Value of the Coordinate.
      Parameters:
      z - Z Value
    • getMagnitude

      public double getMagnitude()
      Description copied from interface: Coordinate
      Gets the magnitude of the Coordinate.
      Specified by:
      getMagnitude in interface Coordinate
      Returns:
      Coordinate Magnitude
    • getDimension

      public Dimension getDimension()
      Description copied from interface: Coordinate
      Gets the dimension of the Coordinate.
      Specified by:
      getDimension in interface Coordinate
      Returns:
      Coordinate Dimension
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Coordinate
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Specified by:
      toString in interface Coordinate
      Overrides:
      toString in class Object
    • fromString

      @NotNull public static @NotNull Coordinate3D fromString(String point)
      Parses a 3D Coordinate from a string.
      Parameters:
      point - String
      Returns:
      3D Coordinate