Enum 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 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
The front-right corner.This is NOT a valid rotational angle - attempting to use it as so may cause an error.
-
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
The front-left corner.This is NOT a valid rotational angle - attempting to use it as so may cause an error.
-
BACK_LEFT
The back-left corner.This is NOT a valid rotational angle - attempting to use it as so may cause an error.
-
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
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
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 namejava.lang.NullPointerException
- if the argument is null
-