ticketdo.java

来自「This book shows you how to use JBoss to 」· Java 代码 · 共 37 行

JAVA
37
字号
package com.titan.travelagent;
     
import com.titan.domain.Cruise;
import com.titan.domain.Cabin;
import com.titan.domain.Customer;
     
public class TicketDO implements java.io.Serializable {
    public int customerID;
    public int cruiseID;
    public int cabinID;
    public double price;
    public String description;
    
    public TicketDO(Customer customer, Cruise cruise, 
        Cabin cabin, double price) {        
            description = customer.getFirstName( )+
                " " + customer.getLastName( ) + 
                " has been booked for the "
                + cruise.getName( ) + 
                " cruise on ship " + 
                  cruise.getShip( ).getName( ) + ".\n" +  
                " Your accommodations include " + 
                  cabin.getName( ) + 
                " a " + cabin.getBedCount( ) + 
                " bed cabin on deck level " + cabin.getDeckLevel( ) + 
                ".\n Total charge = " + price;
            customerID = customer.getId();
            cruiseID = cruise.getId();
            cabinID = cabin.getId();
            this.price = price;
        }
        
    public String toString( ) {
        return description;
    }
}

⌨️ 快捷键说明

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