Package org.goplanit.utils.unit
Enum UnitType
- java.lang.Object
-
- java.lang.Enum<UnitType>
-
- org.goplanit.utils.unit.UnitType
-
- All Implemented Interfaces:
Serializable
,Comparable<UnitType>
public enum UnitType extends Enum<UnitType>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UnitGroup
getGroup()
String
getName()
boolean
isCompatible(UnitType unitType)
Verify compatibility based on whther or not the types belong to the same groupstatic UnitType
valueOf(String name)
Returns the enum constant of this type with the specified name.static UnitType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final UnitType NONE
-
VEH
public static final UnitType VEH
-
PCU
public static final UnitType PCU
-
KM
public static final UnitType KM
-
METER
public static final UnitType METER
-
HOUR
public static final UnitType HOUR
-
SECOND
public static final UnitType SECOND
-
MINUTE
public static final UnitType MINUTE
-
SRS
public static final UnitType SRS
-
-
Method Detail
-
values
public static UnitType[] 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 (UnitType c : UnitType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UnitType valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
public String getName()
-
getGroup
public UnitGroup getGroup()
-
isCompatible
public boolean isCompatible(UnitType unitType)
Verify compatibility based on whther or not the types belong to the same group- Parameters:
unitType
- to verify- Returns:
- true when in the same group, false otherwise
-
-