Enum Class TechRating

java.lang.Object
java.lang.Enum<TechRating>
megamek.common.enums.TechRating
All Implemented Interfaces:
Serializable, Comparable<TechRating>, Constable

public enum TechRating extends Enum<TechRating>
  • Enum Constant Details

  • Method Details

    • values

      public static TechRating[] 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

      public static TechRating valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getIndex

      public int getIndex()
    • getName

      public String getName()
    • isBetterThan

      public boolean isBetterThan(TechRating other)
      Determines whether this TechRating represents a higher technological level than the specified rating.

      The comparison is based on the internal index value; a larger index indicates a more advanced rating.

      Parameters:
      other - the TechRating to compare against
      Returns:
      true if this rating is strictly higher than other
    • isBetterOrEqualThan

      public boolean isBetterOrEqualThan(TechRating other)
      Determines whether this TechRating represents a technological level that is greater than or equal to the specified rating.

      The comparison is based on the internal index value; a larger or equal index indicates an equivalent or more advanced rating.

      Parameters:
      other - the TechRating to compare against
      Returns:
      true if this rating is greater than or equal to other
    • isValidIndex

      public static boolean isValidIndex(int idx)
    • fromIndex

      public static TechRating fromIndex(int idx)
    • fromName

      public static TechRating fromName(String name)