Class Position

java.lang.Object
jadex.bdi.puzzle.Position
All Implemented Interfaces:
Serializable

public class Position extends Object implements Serializable
A position has two coordinates.
See Also:
  • Field Summary

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

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

    Modifier and Type
    Method
    Description
    boolean
    Test if two positions are equal.
    int
    Get the x value.
    int
    Get the y value.
    int
    Calculate the hash code.
    void
    setX(int x)
    Set x.
    void
    setY(int y)
    Set y.
    Get the string representation.

    Methods inherited from class java.lang.Object

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

    • x

      protected int x
      The x position.
    • y

      protected int y
      The y position.
  • Constructor Details

    • Position

      public Position()
      Create a position.
    • Position

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

    • getX

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

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

      public void setX(int x)
      Set x.
      Parameters:
      x -
    • setY

      public void setY(int y)
      Set y.
      Parameters:
      y -
    • equals

      public boolean equals(Object o)
      Test if two positions are equal.
      Overrides:
      equals in class Object
      Returns:
      True, if equal.
    • hashCode

      public int hashCode()
      Calculate the hash code.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
    • toString

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