Class Position


  • public class Position
    extends java.lang.Object
    The position on a grid.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int x
      The x position.
      protected int y
      The y position.
    • Constructor Summary

      Constructors 
      Constructor Description
      Position​(int x, int y)
      Create a position.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int getX()
      Get the x value.
      int getY()
      Get the y value.
      int hashCode()  
      java.lang.String toString()
      Get the string representation.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • x

        protected int x
        The x position.
      • y

        protected int y
        The y position.
    • Constructor Detail

      • Position

        public Position​(int x,
                        int y)
        Create a position.
    • Method Detail

      • getX

        public int getX()
        Get the x value.
      • getY

        public int getY()
        Get the y value.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.