📄 queue.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -