|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorderprocessing.OrderProcessor
This class accepts and fulfills orders from customers. It can create an order from appropriate information and it can create an invoice from an order. It also maintains the logic for opening and closing the object database as the program starts and quits. It also does some writing to System.out that would better be handled by dialogs.
Field Summary | |
static OrderProcessor |
orderProcessor
|
Method Summary | |
static void |
close(java.lang.String filename)
close the database at the end of processing. |
static java.lang.String |
databaseName()
The name of the database file |
Invoice |
generateInvoice(Order order)
Generate an invoice from an order. |
static void |
main(java.lang.String[] args)
This method is used only to initialize the database to empty after a catastrophic failure in which the data must all be rebuild from external data.It will leave you with an empty database. |
Order |
newOrder(java.lang.String customer,
java.lang.String terms,
java.lang.String shipping,
java.util.ArrayList items,
CalculationCalendar orderDate,
CalculationCalendar requestedShipDate,
CalculationCalendar cancelDate)
Generate an order object from string data sent to it. |
static void |
open(java.lang.String filename)
Open the database at the beginning of processing by reading it into memory from the saved version. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static OrderProcessor orderProcessor
Method Detail |
public Order newOrder(java.lang.String customer, java.lang.String terms, java.lang.String shipping, java.util.ArrayList items, CalculationCalendar orderDate, CalculationCalendar requestedShipDate, CalculationCalendar cancelDate)
customer
- String with customer number (C5001, C5001,...)shipping
- The shipping address normally associated with this customer
(will change)items
- An ArrayList of strings each of which is a quantity,
itemnumber, price, and. description. There is a tide ~
separation between the fields.orderDate
- The date of this order.requestedShipDate
- the date shipment is requested (Order date + 7days).cancelDate
- the date the order should be cancelled if not yet shipped.
public Invoice generateInvoice(Order order)
order
- An order previously placed by a customer.
public static void close(java.lang.String filename)
filename
- the name of the file to write ontopublic static void open(java.lang.String filename)
filename
- the name of the file to read frompublic static java.lang.String databaseName()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |