megamek.common
Class EquipmentMode

java.lang.Object
  extended by megamek.common.EquipmentMode

public class EquipmentMode
extends java.lang.Object

Class EquipmentMode describes a Equipment's particular mode.

The getDisplayableName method allows you to obtain the localized string from a predefined ResourceBundle.

The equals function allows to check if the mode is equivalent to the mode identified by the given name.

There is no way to create the instance of the EquipmentMode directly, use EquipmentMode#getMode instead.

See Also:
EquipmentType, Mounted

Field Summary
protected static java.util.Hashtable<java.lang.String,EquipmentMode> modesHash
          Hash of all modes
protected  java.lang.String name
          Unique internal mode identifier.
 
Constructor Summary
protected EquipmentMode(java.lang.String name)
           Protected constructor since we don't allow direct creation of the mode.
 
Method Summary
 boolean equals(java.lang.String modeName)
           
 java.lang.String getDisplayableName()
           
static EquipmentMode getMode(java.lang.String name)
           
 java.lang.String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modesHash

protected static java.util.Hashtable<java.lang.String,EquipmentMode> modesHash
Hash of all modes


name

protected java.lang.String name
Unique internal mode identifier. Used as the part of the key to look for the displayable name presented to user.

Constructor Detail

EquipmentMode

protected EquipmentMode(java.lang.String name)

Protected constructor since we don't allow direct creation of the mode. Modes available via getMode

Contructs the new mode denoted by the given name.

Parameters:
name - unique mode identifier
Method Detail

getName

public java.lang.String getName()
Returns:
mode name/identifier

getDisplayableName

public java.lang.String getDisplayableName()
Returns:
the localized displayable name presented by the GUI to the user.

getMode

public static EquipmentMode getMode(java.lang.String name)
Parameters:
name - mode name
Returns:
unique mode that corresponds to the given name

equals

public boolean equals(java.lang.String modeName)
Parameters:
modeName - The name of the mode to compare with
Returns:
true if this mode equals to the mode denoted by the given name