KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > j2ee > blueprints > consumerwebsite > TransportationBean


1 /*
2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * - Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * - Redistribution in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Sun Microsystems, Inc. or the names of
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * This software is provided "AS IS," without a warranty of any
21 * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
22 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
24 * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
25 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
26 * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
27 * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
28 * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
29 * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
30 * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
31 * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that Software is not designed, licensed or intended
34 * for use in the design, construction, operation or maintenance of
35 * any nuclear facility.
36 */

37
38 package com.sun.j2ee.blueprints.consumerwebsite;
39
40 import java.io.Serializable JavaDoc;
41 import com.sun.j2ee.blueprints.catalog.*;
42
43
44 /**
45  * A JavaBeans component representing transportation details.
46  */

47 public class TransportationBean extends Transportation implements Serializable JavaDoc {
48     
49     
50     public TransportationBean(String JavaDoc transportationId,
51                                                 String JavaDoc name,
52                                                 String JavaDoc description,
53                                                 String JavaDoc imageURI,
54                                                 double price,
55                                                 String JavaDoc origin,
56                                                 String JavaDoc destination,
57                                                 String JavaDoc carrier,
58                                                 String JavaDoc departureTime,
59                                                 String JavaDoc arrivalTime,
60                                                 String JavaDoc travelClass) {
61         
62         super(transportationId, name, description, imageURI, price, origin,
63         destination, carrier, departureTime, arrivalTime, travelClass);
64         
65     }
66     public TransportationBean() {
67         
68     }
69     
70     //getter methods are provided in the base class
71

72     //setter methods
73

74     public void setId(String JavaDoc transportationId) {
75         this.transportationId = transportationId;
76     }
77     
78     public String JavaDoc getId() {
79         return transportationId;
80     }
81     
82     public void setName(String JavaDoc name) {
83         this.name = name;
84     }
85     
86     public void setDescription(String JavaDoc description) {
87         this.description = description;
88     }
89     
90     public void setImageURI(String JavaDoc imageURI) {
91         this.imageURI = imageURI;
92     }
93     
94     public void setPrice(double price) {
95         this.price = price;
96     }
97     public void setOrigin(String JavaDoc origin) {
98         this.origin = origin;
99     }
100     public void setDestination(String JavaDoc destination) {
101         this.destination= destination;
102     }
103     public void setCarrier(String JavaDoc carrier) {
104         this.carrier= carrier;
105     }
106     public void setDepartureTime(String JavaDoc departureTime) {
107         this.departureTime= departureTime;
108     }
109     public void setArrivalTime(String JavaDoc arrivalTime) {
110         this.arrivalTime= arrivalTime;
111     }
112     public void setTravelClass(String JavaDoc travelClass) {
113         this.travelClass= travelClass;
114     }
115     
116     
117     public String JavaDoc toString() {
118         return "Transportation[id=" + getTransportationId() +
119         ", name=" + getName() +
120         ", price=" + getPrice() +
121         ", description=" + getDescription() +
122         ", origin=" + getOrigin() +
123         ", destination=" + getDestination()+
124         ", carrier=" + getCarrier() +
125         ", departure time=" + getDepartureTime() +
126         ", arrival time =" + getArrivalTime() +
127         ", travel class =" + getTravelClass() +
128         "]";
129     }
130     
131 }
132
Popular Tags