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

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

public class Good
extends Object
implements Serializable, Comparable<Good>

A meta class describing an economic good in the simulation.

See Also:
Serialized Form

Field Summary
static String AMOUNT_RESOURCE
           
static String EQUIPMENT
           
static String ITEM_RESOURCE
           
static String VEHICLE
           
 
Method Summary
 int compareTo(Good o)
          Compares this object with the specified object for order.
 boolean equals(Object object)
          Checks if an object is equal to this object.
 String getCategory()
          Gets the good's category string.
 Class getClassType()
          Gets the good's class.
 String getName()
          Gets the good's name.
 Object getObject()
          Gets the good's object if any.
 int hashCode()
          Gets the hash code value.
 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 String AMOUNT_RESOURCE
See Also:
Constant Field Values

ITEM_RESOURCE

public static final String ITEM_RESOURCE
See Also:
Constant Field Values

EQUIPMENT

public static final String EQUIPMENT
See Also:
Constant Field Values

VEHICLE

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

getName

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

Returns:
name

getClassType

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

Returns:
class

getObject

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

Returns:
object or null if none.

getCategory

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

Returns:
category.

toString

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

Overrides:
toString in class Object
Returns:
string.

equals

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

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

hashCode

public int hashCode()
Gets the hash code value.

Overrides:
hashCode in class Object

compareTo

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

Specified by:
compareTo in interface 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.


Copyright © 2009-2013. All Rights Reserved.