Êëàññ Fulfilment (Fullfilment.java)
Ëèñòèíã 5.3. Êëàññ Fulfilment (Fullfilment.java)
package com.XmlEcomBook.Chap05;
import java.util.Date;
import java.util.StringTokenizer;
public class Fulfillment {
String shipper;
//UPS, Fedex, USPS, etc.
String shippingClass;
//Overnight, 2 Day, regular, frieght, etc.
double costToCustomer;
//How much the customer is charged for shipping
String trackingNumber = "NO_TRACKING_NUMBER";
String dateSent = "NOT_SENT_YET";
public Fulfillment() {
}
public void setShipper( String newShipper ) {
shipper = newShipper;
}
public String getShipper() {
return shipper;
}
public void setShipperAndClass( String shipperAndClass ) {
StringTokenizer st = new StringTokenizer( shipperAndClass );
if( st.hasMoreTokens() ) {
shipper = st.nextToken();
if( st.hasMoreTokens() ) {
shippingClass = st.nextToken();
}
}
}
public void setShippingClass( String newClass ) {
shippingClass = newClass;
}
public String getShippingClass() {
return shippingClass;
}
public void setTrackingNumber( String newNumber ) {
trackingNumber = newNumber;
}
public String getTrackingNumber() {
return trackingNumber;
}
public void setDateSent( String newDate ) { dateSent = newDate;
}
public String getDateSent() {
return dateSent;
}
public double getCostToCustomer() {
return costToCustomer;
}
public void setCostToCustomer( double newCost ) {
costToCustomer = newCost;
}
}
Ñîäåðæàíèå ðàçäåëà