/** * Builds the shipment. * * @return shipment * @throws IllegalArgumentException if neither pickup-location nor pickup-coord is set or if neither delivery-location nor delivery-coord * is set */ public Shipment build() { if (pickupLocation_ == null) throw new IllegalArgumentException("The pickup location is missing."); if (deliveryLocation_ == null) throw new IllegalArgumentException("The delivery location is missing."); capacity = capacityBuilder.build(); skills = skillBuilder.build(); return new Shipment(this); }
Shipment: function () { return new Shipment();
public void actionPerformed(ActionEvent e){ if (e.getActionCommand().equals("Display")){ //"Display" is the text on the JButton String employeeNum = empNumTF.getText(); String shipmentNum = shipNumTF.getText(); String revDate = dateTF.getText(); //These text fields String revTime = timeTF.getText(); //not coded in String supplierName = supplTF.getText(); //my example ShipmentFrame sf = new ShipmentFrame(new Shipment(shipmentNum, supplierName, revDate, revTime, employeeNum)); //I'm just guessing at the order these come in sf.setVisible(true); } }
/** * Builds the shipment. * * @return shipment * @throws IllegalArgumentException if neither pickup-location nor pickup-coord is set or if neither delivery-location nor delivery-coord * is set */ public Shipment build() { if (pickupLocation_ == null) throw new IllegalArgumentException("pickup location is missing"); if (deliveryLocation_ == null) throw new IllegalArgumentException("delivery location is missing"); capacity = capacityBuilder.build(); skills = skillBuilder.build(); return new Shipment(this); }