org.mars_sim.msp.simulation.resource
Class PartPackageConfig

java.lang.Object
  extended by org.mars_sim.msp.simulation.resource.PartPackageConfig
All Implemented Interfaces:
java.io.Serializable

public class PartPackageConfig
extends java.lang.Object
implements java.io.Serializable

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

See Also:
Serialized Form

Constructor Summary
PartPackageConfig(org.w3c.dom.Document partPackageDoc)
          Constructor
 
Method Summary
 java.util.Map<Part,java.lang.Integer> getPartsInPackage(java.lang.String name)
          Gets the parts stored in a given part package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartPackageConfig

public PartPackageConfig(org.w3c.dom.Document partPackageDoc)
                  throws java.lang.Exception
Constructor

Parameters:
partPackageDoc - the part package XML document.
Throws:
java.lang.Exception - if error reading XML document
Method Detail

getPartsInPackage

public java.util.Map<Part,java.lang.Integer> getPartsInPackage(java.lang.String name)
                                                        throws java.lang.Exception
Gets the parts stored in a given part package.

Parameters:
name - the part package name.
Returns:
parts and their numbers.
Throws:
java.lang.Exception - if part package name does not match any packages.