Enum EShipType
- java.lang.Object
-
- java.lang.Enum<EShipType>
-
- ch.sahits.game.openpatrician.model.ship.EShipType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<EShipType>
public enum EShipType extends java.lang.Enum<EShipType>
Types of the ships. Additional to different class types this type is used for easy distinction (in switch statements) and in cases where some action based on the ship type has to be taken without the presence of an instance of IShip (in ship building).- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Mar 9, 2013
-
-
Constructor Summary
Constructors Modifier Constructor Description private
EShipType()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EShipType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EShipType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static EShipType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EShipType c : EShipType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EShipType 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 namejava.lang.NullPointerException
- if the argument is null
-
-