Klasse IntPoint

java.lang.Object
pp.battleship.model.IntPoint
Alle implementierten Schnittstellen:
IntPosition

public final class IntPoint extends Object implements IntPosition
Represents a point in the two-dimensional plane with integer coordinates.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    IntPoint(int x, int y)
    Constructs a new IntPoint with the specified coordinates.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Gets the x-coordinate of the point.
    int
    Gets the y-coordinate of the point.
    int
    Returns a hash code value for the IntPoint.
    Returns a string representation of the IntPoint.

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • IntPoint

      public IntPoint(int x, int y)
      Constructs a new IntPoint with the specified coordinates.
      Parameter:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
  • Methodendetails

    • getX

      public int getX()
      Gets the x-coordinate of the point.
      Angegeben von:
      getX in Schnittstelle IntPosition
      Gibt zurück:
      the x-coordinate
    • getY

      public int getY()
      Gets the y-coordinate of the point.
      Angegeben von:
      getY in Schnittstelle IntPosition
      Gibt zurück:
      the y-coordinate
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Setzt außer Kraft:
      equals in Klasse Object
      Parameter:
      obj - the reference object with which to compare
      Gibt zurück:
      true if this object is the same as the obj argument; false otherwise
    • hashCode

      public int hashCode()
      Returns a hash code value for the IntPoint.
      Setzt außer Kraft:
      hashCode in Klasse Object
      Gibt zurück:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of the IntPoint.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a string representation of the object