Class CoordinateMatrix

java.lang.Object
xyz.calcugames.levelz.coord.CoordinateMatrix
All Implemented Interfaces:
Iterable<Coordinate>
Direct Known Subclasses:
CoordinateMatrix2D, CoordinateMatrix3D

public abstract class CoordinateMatrix extends Object implements Iterable<Coordinate>
Represents a matrix of coordinates.
  • Constructor Details

    • CoordinateMatrix

      protected CoordinateMatrix(@NotNull @NotNull Dimension dimension)
      Creates a new Coordinate Matrix.
      Parameters:
      dimension - The dimension of the matrix.
  • Method Details

    • getDimension

      @NotNull public final @NotNull Dimension getDimension()
      Gets the dimension of the matrix.
      Returns:
      The dimension of the matrix.
    • getCoordinates

      @NotNull public abstract @NotNull Set<? extends Coordinate> getCoordinates()
      Gets the coordinates in the matrix.
      Returns:
      The coordinates in the matrix.
    • getStart

      @NotNull public abstract @NotNull Coordinate getStart()
      Gets the starting coordinate of the matrix.
      Returns:
      The starting coordinate of the matrix.
    • toString

      public abstract String toString()
      Gets the string version of this coordinate matrix.
      Overrides:
      toString in class Object
      Returns:
      This Coordinate Matrix as a string, represented in LevelZ format.
    • iterator

      @NotNull public final @NotNull Iterator<Coordinate> iterator()
      Specified by:
      iterator in interface Iterable<Coordinate>
    • equals

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

      public final int hashCode()
      Overrides:
      hashCode in class Object