org.mars_sim.msp.core.interplanetary.transport.resupply
Class Resupply

java.lang.Object
  extended by org.mars_sim.msp.core.interplanetary.transport.resupply.Resupply
All Implemented Interfaces:
Serializable, Comparable<Transportable>, Transportable

public class Resupply
extends Object
implements Serializable, Transportable

Resupply mission from Earth for a settlement.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.mars_sim.msp.core.interplanetary.transport.Transportable
ARRIVED, CANCELED, EARTH, IN_TRANSIT, MARS, PLANNED
 
Constructor Summary
Resupply(MarsClock arrivalDate, Settlement settlement)
          Constructor
 
Method Summary
 void commitModification()
          Commits a set of modifications for the resupply mission.
 int compareTo(Transportable o)
           
 void destroy()
          Prepare object for garbage collection.
 MarsClock getArrivalDate()
          Gets the arrival date at the destination.
 MarsClock getLaunchDate()
          Gets the launch date from the launching location.
 String getName()
          Gets the name of the transportable.
 List<String> getNewBuildings()
          Gets a list of the resupply buildings.
 Map<String,Integer> getNewEquipment()
          Gets a map of the resupply equipment.
 int getNewImmigrantNum()
          Gets the number of immigrants in the resupply mission.
 Map<Part,Integer> getNewParts()
          Gets a map of resupply parts.
 Map<AmountResource,Double> getNewResources()
          Gets a map of the resupply resources.
 List<String> getNewVehicles()
          Gets a list of the resupply vehicles.
 Settlement getSettlement()
          Gets the destination settlement.
 String getTransitState()
          Gets the current transit state.
 void performArrival()
          Perform the arrival of the transportable.
 void setArrivalDate(MarsClock arrivalDate)
          Sets the arrival date of the resupply mission.
 void setLaunchDate(MarsClock launchDate)
          Sets the launch date of the resupply mission.
 void setNewBuildings(List<String> newBuildings)
          Sets the list of resupply buildings.
 void setNewEquipment(Map<String,Integer> newEquipment)
          Sets the map of resupply equipment.
 void setNewImmigrantNum(int newImmigrantNum)
          Sets the number of immigrants in the resupply mission.
 void setNewParts(Map<Part,Integer> newParts)
          Sets the map of resupply parts.
 void setNewResources(Map<AmountResource,Double> newResources)
          Sets the map of resupply resources.
 void setNewVehicles(List<String> newVehicles)
          Sets the list of resupply vehicles.
 void setSettlement(Settlement settlement)
          Sets the destination settlement.
 void setTransitState(String transitState)
          Sets the current transit state.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Resupply

public Resupply(MarsClock arrivalDate,
                Settlement settlement)
Constructor

Parameters:
arrivalDate - the arrival date of the supplies.
settlement - the settlement receiving the supplies.
Method Detail

getLaunchDate

public MarsClock getLaunchDate()
Description copied from interface: Transportable
Gets the launch date from the launching location.

Specified by:
getLaunchDate in interface Transportable
Returns:
launch date as a MarsClock instance.

setLaunchDate

public void setLaunchDate(MarsClock launchDate)
Sets the launch date of the resupply mission.

Parameters:
launchDate - the launch date.

getNewBuildings

public List<String> getNewBuildings()
Gets a list of the resupply buildings.

Returns:
list of building types.

setNewBuildings

public void setNewBuildings(List<String> newBuildings)
Sets the list of resupply buildings.

Parameters:
newBuildings - list of building types.

getNewVehicles

public List<String> getNewVehicles()
Gets a list of the resupply vehicles.

Returns:
list of vehicle types.

setNewVehicles

public void setNewVehicles(List<String> newVehicles)
Sets the list of resupply vehicles.

Parameters:
newVehicles - list of vehicle types.

getNewEquipment

public Map<String,Integer> getNewEquipment()
Gets a map of the resupply equipment.

Returns:
map of equipment type and number.

setNewEquipment

public void setNewEquipment(Map<String,Integer> newEquipment)
Sets the map of resupply equipment.

Parameters:
newEquipment - map of equipment type and number.

getNewImmigrantNum

public int getNewImmigrantNum()
Gets the number of immigrants in the resupply mission.

Returns:
the number of immigrants.

setNewImmigrantNum

public void setNewImmigrantNum(int newImmigrantNum)
Sets the number of immigrants in the resupply mission.

Parameters:
newImmigrantNum - the number of immigrants.

getNewResources

public Map<AmountResource,Double> getNewResources()
Gets a map of the resupply resources.

Returns:
map of resource and amount (kg).

setNewResources

public void setNewResources(Map<AmountResource,Double> newResources)
Sets the map of resupply resources.

Parameters:
newResources - map of resource and amount (kg).

getNewParts

public Map<Part,Integer> getNewParts()
Gets a map of resupply parts.

Returns:
map of part and number.

setNewParts

public void setNewParts(Map<Part,Integer> newParts)
Sets the map of resupply parts.

Parameters:
newParts - map of part and number.

getArrivalDate

public MarsClock getArrivalDate()
Description copied from interface: Transportable
Gets the arrival date at the destination.

Specified by:
getArrivalDate in interface Transportable
Returns:
arrival date as a MarsClock instance.

setArrivalDate

public void setArrivalDate(MarsClock arrivalDate)
Sets the arrival date of the resupply mission.

Parameters:
arrivalDate - the arrival date.

getSettlement

public Settlement getSettlement()
Gets the destination settlement.

Returns:
destination settlement.

setSettlement

public void setSettlement(Settlement settlement)
Sets the destination settlement.

Parameters:
settlement - the destination settlement.

commitModification

public void commitModification()
Commits a set of modifications for the resupply mission.


destroy

public void destroy()
Description copied from interface: Transportable
Prepare object for garbage collection.

Specified by:
destroy in interface Transportable

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Transportable o)
Specified by:
compareTo in interface Comparable<Transportable>

getName

public String getName()
Description copied from interface: Transportable
Gets the name of the transportable.

Specified by:
getName in interface Transportable
Returns:
name string.

getTransitState

public String getTransitState()
Description copied from interface: Transportable
Gets the current transit state.

Specified by:
getTransitState in interface Transportable
Returns:
transit state string.

setTransitState

public void setTransitState(String transitState)
Description copied from interface: Transportable
Sets the current transit state.

Specified by:
setTransitState in interface Transportable
Parameters:
transitState - the transit state string.

performArrival

public void performArrival()
Description copied from interface: Transportable
Perform the arrival of the transportable.

Specified by:
performArrival in interface Transportable


Copyright © 2009-2013. All Rights Reserved.