Enum Rectangle.Corners

java.lang.Object
java.lang.Enum<Rectangle.Corners>
me.wobblyyyy.pathfinder.geometry.Rectangle.Corners
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Rectangle.Corners>, java.lang.constant.Constable
Enclosing class:
Rectangle

public static enum Rectangle.Corners
extends java.lang.Enum<Rectangle.Corners>
A list of different positions on a rectangle.

A more apt name would certainly be "positions." You can't tell me with a straight face that you could seriously consider "center" to be one of the FOUR corners of a rectangle. Should we consider refactoring this in the future?

As of right now, Center is the only valid draw corner - all of the rest of them may throw and error during construction.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    BACK_LEFT
    The back-left corner.
    BACK_RIGHT
    The back-right corner.
    CENTER
    The center of the rectangle.
    FRONT_LEFT
    The front-left corner.
    FRONT_RIGHT
    The front-right corner.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private Corners()  
  • Method Summary

    Modifier and Type Method Description
    static Rectangle.Corners valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Rectangle.Corners[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FRONT_RIGHT

      public static final Rectangle.Corners FRONT_RIGHT
      The front-right corner.

      This is NOT a valid rotational angle - attempting to use it as so may cause an error.

    • BACK_RIGHT

      public static final Rectangle.Corners BACK_RIGHT
      The back-right corner.

      This is NOT a valid rotational angle - attempting to use it as so may cause an error.

    • FRONT_LEFT

      public static final Rectangle.Corners FRONT_LEFT
      The front-left corner.

      This is NOT a valid rotational angle - attempting to use it as so may cause an error.

    • BACK_LEFT

      public static final Rectangle.Corners BACK_LEFT
      The back-left corner.

      This is NOT a valid rotational angle - attempting to use it as so may cause an error.

    • CENTER

      public static final Rectangle.Corners CENTER
      The center of the rectangle.

      This is the ONLY valid rotational angle - all of the rest of them haven't been implemented yet.

  • Constructor Details

    • Corners

      private Corners()
  • Method Details

    • values

      public static Rectangle.Corners[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Rectangle.Corners valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null