Package megamek.common.enums
Enum Class TechRating
- All Implemented Interfaces:
Serializable,Comparable<TechRating>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic TechRatingfromIndex(int idx) static TechRatingintgetIndex()getName()booleanisBetterOrEqualThan(TechRating other) Determines whether thisTechRatingrepresents a technological level that is greater than or equal to the specified rating.booleanisBetterThan(TechRating other) Determines whether thisTechRatingrepresents a higher technological level than the specified rating.static booleanisValidIndex(int idx) static TechRatingReturns the enum constant of this class with the specified name.static TechRating[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
A
-
B
-
C
-
D
-
E
-
F
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getIndex
public int getIndex() -
getName
-
isBetterThan
Determines whether thisTechRatingrepresents a higher technological level than the specified rating.The comparison is based on the internal
indexvalue; a larger index indicates a more advanced rating.- Parameters:
other- theTechRatingto compare against- Returns:
trueif this rating is strictly higher thanother
-
isBetterOrEqualThan
Determines whether thisTechRatingrepresents a technological level that is greater than or equal to the specified rating.The comparison is based on the internal
indexvalue; a larger or equal index indicates an equivalent or more advanced rating.- Parameters:
other- theTechRatingto compare against- Returns:
trueif this rating is greater than or equal toother
-
isValidIndex
public static boolean isValidIndex(int idx) -
fromIndex
-
fromName
-