aircraftevent.java
来自「一个飞机调度员模拟训练程序,可以添加跑道数量,控制飞机飞行的速度.默认的密码可以」· Java 代码 · 共 65 行
JAVA
65 行
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 + =
减小字号Ctrl + -
显示快捷键?