|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdbrown.Order
class Order
A simple class representing restaurant orders that tracks how many objects have been instantiated from it and whether the maximum number of objects allowed have been created.
Field Summary | |
---|---|
private static int |
count
Tracks the total number of orders placed. |
private int |
number
The number of a particular order. |
private static int |
ORDERS
The maximum number of orders tha can be placed. |
Constructor Summary | |
---|---|
Order()
The Order constructor. |
Method Summary | |
---|---|
int |
getNumber()
|
boolean |
isLastOrder()
Determines whether an order is the last order. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static int count
private static final int ORDERS
private int number
getNumber
, but cannot be set.
Constructor Detail |
---|
public Order()
Order
constructor.
Method Detail |
---|
public int getNumber()
public boolean isLastOrder()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |