|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdbrown.Chef
class Chef
Represents a chef in a restaurant who prepares orders until the restaurant closes. After finishing an order the chef notifies the waiter that the order is ready.
Field Summary | |
---|---|
static int |
COOKING
|
static int |
DONE
|
static int |
FREE
|
private Order |
order
|
private Restaurant |
restaurant
|
private int |
status
|
private java.lang.Thread |
t
The chef's execution thread. |
private java.util.ArrayList<IView> |
views
|
Constructor Summary | |
---|---|
Chef(Restaurant r)
The chef constructor |
Method Summary | |
---|---|
void |
addView(IView newView)
Adds a view to the model's collection of views. |
Order |
getOrder()
|
int |
getStatus()
|
void |
run()
|
void |
setOrder(Order order)
|
void |
setStatus(int status)
|
private void |
updateViews()
Updates all views attached to the model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COOKING
public static final int DONE
public static final int FREE
private Order order
private Restaurant restaurant
private int status
private java.lang.Thread t
private java.util.ArrayList<IView> views
Constructor Detail |
---|
public Chef(Restaurant r)
r
- The restaurant the chef works in.Method Detail |
---|
public void addView(IView newView)
newView
- The view to add to the model's collection of views.public Order getOrder()
public int getStatus()
public void run()
run
in interface java.lang.Runnable
public void setOrder(Order order)
order
- The order to set.public void setStatus(int status)
status
- The status to set.private void updateViews()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |