Enum-Klasse Rotation

java.lang.Object
java.lang.Enum<Rotation>
pp.battleship.model.Rotation
Alle implementierten Schnittstellen:
Serializable, Comparable<Rotation>, Constable

public enum Rotation extends Enum<Rotation> implements Serializable
Represents the rotation of a ship and provides functionality related to rotation.
  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum-Konstanten - Übersicht

    Enum-Konstanten
    Enum-Konstante
    Beschreibung
    Represents the ship facing downwards.
    Represents the ship facing leftwards.
    Represents the ship facing rightwards.
    Represents the ship facing upwards.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    int
    dx()
    Gets the change in x-coordinate corresponding to this rotation.
    int
    dy()
    Gets the change in y-coordinate corresponding to this rotation.
    Rotates the orientation clockwise and returns the next rotation.
    static Rotation
    Gibt die Enum-Konstante dieser Klasse mit dem angegebenen Namen zurück.
    static Rotation[]
    Gibt ein Array mit den Konstanten dieser Enum-Klasse in der Reihenfolge ihrer Deklaration zurück.

    Von Klasse geerbte Methoden java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum-Konstanten - Details

    • UP

      public static final Rotation UP
      Represents the ship facing upwards.
    • DOWN

      public static final Rotation DOWN
      Represents the ship facing downwards.
    • LEFT

      public static final Rotation LEFT
      Represents the ship facing leftwards.
  • Methodendetails

    • values

      public static Rotation[] values()
      Gibt ein Array mit den Konstanten dieser Enum-Klasse in der Reihenfolge ihrer Deklaration zurück.
      Gibt zurück:
      ein Array mit den Konstanten dieser Enum-Klasse in der Reihenfolge ihrer Deklaration
    • valueOf

      public static Rotation valueOf(String name)
      Gibt die Enum-Konstante dieser Klasse mit dem angegebenen Namen zurück. Die Zeichenfolge muss exakt mit einer ID übereinstimmen, mit der eine Enum-Konstante in dieser Klasse deklariert wird. (Zusätzliche Leerzeichen sind nicht zulässig.)
      Parameter:
      name - Name der zurückzugebenden Enumerationskonstante.
      Gibt zurück:
      Enumerationskonstante mit dem angegebenen Namen
      Löst aus:
      IllegalArgumentException - wenn diese Enum-Klasse keine Konstante mit dem angegebenen Namen enthält
      NullPointerException - wenn das Argument nicht angegeben wird
    • dx

      public int dx()
      Gets the change in x-coordinate corresponding to this rotation.
      Gibt zurück:
      the change in x-coordinate
    • dy

      public int dy()
      Gets the change in y-coordinate corresponding to this rotation.
      Gibt zurück:
      the change in y-coordinate
    • rotate

      public Rotation rotate()
      Rotates the orientation clockwise and returns the next rotation.
      Gibt zurück:
      the next rotation after rotating clockwise