org.intranet.elevator.model
Class DoorSensor

java.lang.Object
  extended byorg.intranet.sim.ModelElement
      extended byorg.intranet.elevator.model.DoorSensor

public class DoorSensor
extends ModelElement

Deals with obstructions. The state transitions look like this:

State Variables Transitions
state obstruct() unobstruct() [ClearEvent]
CLEAR OBSTRUCTED
[sensorObstructed()]
UNOBSTRUCTED Impossible
OBSTRUCTED Illegal UNOBSTRUCTED Impossible
UNOBSTRUCTED OBSTRUCTED
[sensorObstructed()]
Illegal CLEAR
[sensorCleared()]


Nested Class Summary
private  class DoorSensor.ClearEvent
           
static interface DoorSensor.Listener
           
static class DoorSensor.State
           
 
Field Summary
private  Event clearEvent
           
private  java.util.List listeners
           
private  DoorSensor.State state
           
 
Fields inherited from class org.intranet.sim.ModelElement
eventQueue
 
Constructor Summary
DoorSensor(EventQueue eQ)
           
 
Method Summary
 void addListener(DoorSensor.Listener l)
           
private  void clear()
           
 DoorSensor.State getState()
           
 void obstruct()
           
 void removeListener(DoorSensor.Listener l)
           
 void unobstruct()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

private DoorSensor.State state

clearEvent

private Event clearEvent

listeners

private java.util.List listeners
Constructor Detail

DoorSensor

public DoorSensor(EventQueue eQ)
Method Detail

getState

public DoorSensor.State getState()

obstruct

public void obstruct()

unobstruct

public void unobstruct()

clear

private void clear()

addListener

public void addListener(DoorSensor.Listener l)

removeListener

public void removeListener(DoorSensor.Listener l)