queue.java

来自「一个飞机调度员模拟训练程序,可以添加跑道数量,控制飞机飞行的速度.默认的密码可以」· Java 代码 · 共 51 行

JAVA
51
字号
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.InterruptedException;
import java.awt.geom.Line2D.Float;
/**
 * A simulated queue of planes.
 * 
 * @author James M. Clarke  
 * @version 02/03/2007
 */
public class Queue
{
    // instance variables - replace the example below with your own
    private Position start;
    private float angle;

    /**
	 * Constructor for Queue objects
	 * Aircraft join the queue at a specific position and pointing in a particular direction, and turn clockwise until told to leave the Queue.
	 * 
	 * @param  where  the starting point of the queue, that is, where planes enter the queue
	 * @param  direction  the direction in which planes are travelling when they join the queue, in radians clockwise from the y-axis
	 */
    public Queue(Position where, float direction)
    {       
        start = where;
        angle = direction;
    }
    
     /**
	 * Accessor method for the position where aircraft join the Queue
	 * 
	 * @return     the position where aircraft join the Queue
	 */    
    public Position getPosition()
    {
        return start;
    }
    
     /**
	 * Accessor method for the angle in which the aircraft at moving when they join the queue
	 * 
	 * @return     angle in which the aircraft at moving when they join the queue, in radians clockwise from the y-axis
	 */      
    public float getAngle()
    {
        return angle;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?