org.mars_sim.msp.core.malfunction
Class MalfunctionConfig

java.lang.Object
  extended by org.mars_sim.msp.core.malfunction.MalfunctionConfig
All Implemented Interfaces:
Serializable

public class MalfunctionConfig
extends Object
implements Serializable

Provides configuration information about malfunctions. Uses a DOM document to get the information.

See Also:
Serialized Form

Constructor Summary
MalfunctionConfig(org.jdom.Document malfunctionDoc)
          Constructor
 
Method Summary
 void destroy()
          Prepare object for garbage collection.
 List<Malfunction> getMalfunctionList()
          Gets a list of malfunctions
 String[] getRepairPartNamesForMalfunction(String malfunctionName)
          Gets all the repair part names for a malfunction.
 int getRepairPartNumber(String malfunctionName, String partName)
          Gets the maximum number of a repair part for a malfunction.
 int getRepairPartProbability(String malfunctionName, String partName)
          Gets the probability of a repair part for a malfunction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MalfunctionConfig

public MalfunctionConfig(org.jdom.Document malfunctionDoc)
Constructor

Parameters:
malfunctionDoc - DOM document containing malfunction configuration.
Method Detail

getMalfunctionList

public List<Malfunction> getMalfunctionList()
Gets a list of malfunctions

Returns:
list of malfunctions
Throws:
Exception - when malfunctions can not be resolved.

getRepairPartNamesForMalfunction

public String[] getRepairPartNamesForMalfunction(String malfunctionName)
Gets all the repair part names for a malfunction.

Parameters:
malfunctionName - the name of the malfunction.
Returns:
array of part names.

getRepairPartNumber

public int getRepairPartNumber(String malfunctionName,
                               String partName)
Gets the maximum number of a repair part for a malfunction.

Parameters:
malfunctionName - the name of the malfunction.
partName - the name of the part.
Returns:
the maximum number of parts.

getRepairPartProbability

public int getRepairPartProbability(String malfunctionName,
                                    String partName)
Gets the probability of a repair part for a malfunction.

Parameters:
malfunctionName - the name of the malfunction.
partName - the name of the part.
Returns:
the probability of the repair part.

destroy

public void destroy()
Prepare object for garbage collection.



Copyright © 2009-2013. All Rights Reserved.