⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 firstclass.java

📁 飞机自动订票系统有JAVA SWING 实现gui 主要包括booking system seats, class 等
💻 JAVA
字号:
/* Generated by Together */
import java.io.*;
public class FirstClass extends EconomyClass {
    public FirstClass() {
        super();
        this.noOfLaptops=0;
    }

    public FirstClass(String className,int noOfRow,int noOfColumn,int noOfleft,int noOfright,int noOfmiddle,int noOfLaptops) {
        super(className,noOfRow,noOfColumn,noOfleft,noOfright,noOfmiddle);
        this.noOfLaptops=noOfLaptops;
    }


    public int getNoOfLaptops(){
        return noOfLaptops;
    }

    public void setNoOfLaptops(int noOfLaptops){
            this.noOfLaptops= noOfLaptops;
        }

    public void setFirstClassSeats() {
		 for (int i = 0; i < noOfRow; i++) {
			  for (int j = 0; j < noOfColumn; j++) {
                        if ((j == 0) || (j == noOfColumn - 1)){
                                // message #1.1.1.1.1 to <unnamed>:Seats
                                 this.myseats[i][j] = new Seats(i, j, "window");
                            }
                        else {
                               if((j==noOfleft-1))
                                   this.myseats[i][j].setHasLaptops(true);
                               else{
                                 if(((j == noOfleft) || (j == noOfleft + noOfmiddle - 1) ||(j==noOfleft+noOfright)||
                       			  (j == noOfleft + noOfmiddle)||(j==this.noOfmiddle-1)||(j==this.noOfmiddle)||(j==noOfright-1)||(j==noOfright)||j==(noOfmiddle+noOfright-1))) {
                                        // message #1.1.1.2.1 to <unnamed>:Seats
                                       this.myseats[i][j] = new Seats(i, j, "aisle");
                               }
                            }
                   		 }
           			 }
    			}
    		}

    public String toString() {
        String out=className+"\n";
        for(int i=0; i<noOfRow;i++){
            for(int j=0; j<noOfColumn; j++){
                out+=this.myseats[i][j]+"  ";
            }
            out+="\n";
        }
	return out;

    }

    public void writeFirstClassToFile(BufferedWriter out)throws IOException {
        String end="\n";
        try{
            out.write(className+end);
            out.write(noOfRow+end);
			out.write(noOfColumn+end);
            out.write(noOfleft+end);
            out.write(noOfright+end);
			out.write(noOfmiddle+end);
            out.write(noOfLaptops+end);
            out.write(end);
            for(int i=0;i<noOfRow;i++)
            {
                for(int j=0;j<noOfColumn;j++)
                {
                    this.myseats[i][j].writeSeatsToFile(out);
                }
                out.write(end);
            }
        }catch(IOException e){}
    }
    private int noOfLaptops;
}

⌨️ 快捷键说明

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