org.intranet.elevator.model
Class Door
java.lang.Object
org.intranet.sim.ModelElement
org.intranet.elevator.model.Door
- public class Door
- extends ModelElement
A door that opens and closes.
Valid states:
State |
Variables |
Transitions |
state |
open() |
[OpenEvent] |
close() |
[CloseEvent] |
CLOSED |
|
OPENING |
Impossible |
Illegal |
Impossible |
OPENING |
|
Illegal |
opened(): OPENED [doorOpened()] |
Illegal |
Impossible |
OPENED |
|
Illegal |
Impossible |
close(): CLOSING |
Impossible |
CLOSING |
|
OPENING |
Impossible |
Illegal |
closed(): CLOSED [doorClosed()] |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
state
private Door.State state
percentClosed
private int percentClosed
- Varies from 0 to 100. The door starts closed.
from
private Location from
to
private Location to
listeners
private java.util.List listeners
priorityListeners
private java.util.List priorityListeners
event
private Event event
CLOSE_TIME
private static final long CLOSE_TIME
- See Also:
- Constant Field Values
CLOSE_WAIT_TIME
private static final long CLOSE_WAIT_TIME
- See Also:
- Constant Field Values
Door
Door(EventQueue eQ,
Location fromLocation,
Location toLocation)
getState
public Door.State getState()
setState
private void setState(Door.State state)
getPercentClosed
public int getPercentClosed()
- Returns the percentage the door is closed in its current state.
- Returns:
- An int between 0 and 100.
getFrom
public Location getFrom()
getTo
public Location getTo()
isOpen
public boolean isOpen()
open
public void open()
close
void close()
closed
private void closed()
opened
private void opened()
addListener
public void addListener(Door.Listener l,
boolean highPriority)
removeListener
public void removeListener(Door.Listener l)
getMinimumCycleTime
public long getMinimumCycleTime()