org.mars_sim.msp.simulation.structure.goods
Class Good

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.goods.Good
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Good>

public class Good
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<Good>

A meta class describing an economic good in the simulation.

See Also:
Serialized Form

Field Summary
static java.lang.String AMOUNT_RESOURCE
           
static java.lang.String EQUIPMENT
           
static java.lang.String ITEM_RESOURCE
           
static java.lang.String VEHICLE
           
 
Method Summary
 int compareTo(Good o)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object object)
          Checks if an object is equal to this object.
 java.lang.String getCategory()
          Gets the good's category string.
 java.lang.Class getClassType()
          Gets the good's class.
 java.lang.String getName()
          Gets the good's name.
 java.lang.Object getObject()
          Gets the good's object if any.
 int hashCode()
          Gets the hash code value.
 java.lang.String toString()
          Gets a string representation of the good.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AMOUNT_RESOURCE

public static final java.lang.String AMOUNT_RESOURCE
See Also:
Constant Field Values

ITEM_RESOURCE

public static final java.lang.String ITEM_RESOURCE
See Also:
Constant Field Values

EQUIPMENT

public static final java.lang.String EQUIPMENT
See Also:
Constant Field Values

VEHICLE

public static final java.lang.String VEHICLE
See Also:
Constant Field Values
Method Detail

getName

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

Returns:
name

getClassType

public java.lang.Class getClassType()
Gets the good's class.

Returns:
class

getObject

public java.lang.Object getObject()
Gets the good's object if any.

Returns:
object or null if none.

getCategory

public java.lang.String getCategory()
Gets the good's category string.

Returns:
category.

toString

public java.lang.String toString()
Gets a string representation of the good.

Overrides:
toString in class java.lang.Object
Returns:
string.

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare.
Returns:
true if equal

hashCode

public int hashCode()
Gets the hash code value.

Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Good o)
Compares this object with the specified object for order.

Specified by:
compareTo in interface java.lang.Comparable<Good>
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.