📄 aircraftevent.java
字号:
import java.util.concurrent.*;
/**
* An instruction from the GUI to the simulation that an aircraft in the simulation should change state.
* A null aircraft and a state of 999 can be used for testing purposes to instruct the simulation to create a new aircraft.
* A null runway can be provided for any instruction apart from landing.
*
* @author James M. Clarke
* @version 02/03/2007
*/
public class AircraftEvent
{
private Aircraft myAircraft;
private int state;
private Runway myRunway;
public final static int LAND = 0;
public final static int TURNLEFT = 1;
public final static int TURNRIGHT = 2;
public final static int GOTOQUEUE = 3;
public final static int LEAVE = 6;
public final static int ADD = 999;
/**
* Constructor for AircraftEvent objects
* @param a which aircraft should change state
* @param i the state the aircraft should change to
* @param r the runway the aircraft should change to
*/
public AircraftEvent(Aircraft a, int i, Runway r)
{
myAircraft = a;
state = i;
myRunway = r;
}
/**
* Accessor method for the state that the aircraft should be changed to
*
* @return the state that the aircraft should be changed to
*/
public int getState()
{
return state;
}
/**
* Accessor method for the Aircraft whose state should be changed
*
* @return the Aircraft whose state should be changed
*/
public Aircraft getAircraft()
{
return myAircraft;
}
/**
* Accessor method for the Runway the aircraft should land at
*
* @return the Aircraft whose state should be changed
*/
public Runway getRunway()
{
return myRunway;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -