|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.resource.ItemResource
public class ItemResource
The ItemResource class represents a type of resource that is measured in units, such as simple tools and parts.
Constructor Summary | |
---|---|
protected |
ItemResource(java.lang.String name,
double massPerItem)
Constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object object)
Checks if an object is equal to this object. |
static ItemResource |
findItemResource(java.lang.String name)
Finds an item resource by name. |
static java.util.Set<ItemResource> |
getItemResources()
Gets a ummutable set of all the item resources. |
double |
getMassPerItem()
Gets the mass for an item of the resource. |
java.lang.String |
getName()
Gets the resource's name. |
static ItemResource |
getTestResourceHammer()
Gets a mock item resource of a hammer. |
static ItemResource |
getTestResourcePipeWrench()
Gets a mock item resource of a pipe wrench. |
static ItemResource |
getTestResourceSocketWrench()
Gets a mock item resource of a socket wrench. |
int |
hashCode()
Gets the hash code value. |
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 |
---|
protected ItemResource(java.lang.String name, double massPerItem)
name
- the name of the resource.massPerItem
- the mass (kg) of the resource per item.Method Detail |
---|
public java.lang.String getName()
getName
in interface Resource
public java.lang.String toString()
toString
in class java.lang.Object
public double getMassPerItem()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static final ItemResource findItemResource(java.lang.String name) throws ResourceException
name
- the name of the resource.
ResourceException
- if resource could not be found.public static final java.util.Set<ItemResource> getItemResources()
public static final ItemResource getTestResourceHammer()
public static final ItemResource getTestResourceSocketWrench()
public static final ItemResource getTestResourcePipeWrench()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |