org.mars_sim.msp.simulation.resource
Class AmountResource

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

public final class AmountResource
extends java.lang.Object
implements Resource, java.io.Serializable

The AmountResource class represents a type of resource that is a material measured in mass kg.

See Also:
Serialized Form

Constructor Summary
protected AmountResource(java.lang.String name, Phase phase, boolean lifeSupport)
          Constructor with life support parameter.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks if an object is equal to this object.
static AmountResource findAmountResource(java.lang.String name)
          Finds an amount resource by name.
static java.util.Set<AmountResource> getAmountResources()
          Gets a ummutable set of all the amount resources.
 java.lang.String getName()
          Gets the resource's name
 Phase getPhase()
          Gets the resources material phase.
 int hashCode()
          Gets the hash code value.
 boolean isLifeSupport()
          Checks if life support resource.
 java.lang.String toString()
          Returns the resource as a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AmountResource

protected AmountResource(java.lang.String name,
                         Phase phase,
                         boolean lifeSupport)
Constructor with life support parameter.

Parameters:
name - the resource's name
phase - the material phase of the resource.
lifeSupport - true if life support resource.
Method Detail

getName

public java.lang.String getName()
Gets the resource's name

Specified by:
getName in interface Resource
Returns:
name

toString

public java.lang.String toString()
Returns the resource as a string.

Overrides:
toString in class java.lang.Object

getPhase

public Phase getPhase()
Gets the resources material phase.

Returns:
phase value

isLifeSupport

public boolean isLifeSupport()
Checks if life support resource.

Returns:
true if life support resource.

findAmountResource

public static final AmountResource findAmountResource(java.lang.String name)
                                               throws ResourceException
Finds an amount resource by name.

Parameters:
name - the name of the resource.
Returns:
resource
Throws:
ResourceException - if resource could not be found.

getAmountResources

public static final java.util.Set<AmountResource> getAmountResources()
Gets a ummutable set of all the amount resources.

Returns:
set of amount resources.

equals

public boolean equals(java.lang.Object object)
Checks if an object is equal to this object.

Overrides:
equals in class java.lang.Object
Returns:
true if equal

hashCode

public int hashCode()
Gets the hash code value.

Overrides:
hashCode in class java.lang.Object