org.mars_sim.msp.simulation.structure.building.function
Class BuildingAirlock

java.lang.Object
  extended by org.mars_sim.msp.simulation.Airlock
      extended by org.mars_sim.msp.simulation.structure.building.function.BuildingAirlock
All Implemented Interfaces:
java.io.Serializable

public class BuildingAirlock
extends Airlock

The BuildingAirlock class represents an airlock for a building.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mars_sim.msp.simulation.Airlock
pressurized
 
Constructor Summary
BuildingAirlock(Building building, int capacity)
          Constructor
 
Method Summary
 boolean enterAirlock(Person person, boolean inside)
          Enters a person into the airlock from either the inside or the outside.
protected  void exitAirlock(Person person)
          Causes a person within the airlock to exit either inside or outside.
 Inventory getEntityInventory()
          Gets the inventory of the entity this airlock is attached to.
 java.lang.String getEntityName()
          Gets the name of the entity this airlock is attached to.
 
Methods inherited from class org.mars_sim.msp.simulation.Airlock
activateAirlock, addActivationTime, inAirlock, isInnerDoorOpen, isOuterDoorOpen, timePassing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildingAirlock

public BuildingAirlock(Building building,
                       int capacity)
Constructor

Parameters:
building - the building this airlock of for.
capacity - number of people airlock can hold.
Throws:
java.lang.IllegalArgumentException - if building is not valid or if capacity is less than one.
Method Detail

enterAirlock

public boolean enterAirlock(Person person,
                            boolean inside)
Enters a person into the airlock from either the inside or the outside. Inner or outer door (respectively) must be open for person to enter.

Overrides:
enterAirlock in class Airlock
Parameters:
person - the person to enter the airlock
inside - true if person is entering from inside false if person is entering from outside
Returns:
true if person entered the airlock successfully

exitAirlock

protected void exitAirlock(Person person)
                    throws java.lang.Exception
Causes a person within the airlock to exit either inside or outside.

Specified by:
exitAirlock in class Airlock
Parameters:
person - the person to exit.
Throws:
java.lang.Exception - if person is not in the airlock.

getEntityName

public java.lang.String getEntityName()
Gets the name of the entity this airlock is attached to.

Specified by:
getEntityName in class Airlock
Returns:
name

getEntityInventory

public Inventory getEntityInventory()
Gets the inventory of the entity this airlock is attached to.

Specified by:
getEntityInventory in class Airlock
Returns:
inventory