project4
Class OrderList

java.lang.Object
  extended by project4.OrderList
Direct Known Subclasses:
OrderManager

public abstract class OrderList
extends java.lang.Object


Nested Class Summary
 class OrderList.NoOrderException
          throw this exception when there is no order to cook
 class OrderList.UnAcceptanceOrderException
          throw this exception if the order could not be accepted
 
Field Summary
static int MAX_DIST
           
static int MAX_SEATS
           
 
Constructor Summary
OrderList()
           
 
Method Summary
abstract  void addOrder(Order order, int orderType, int dist, int seats)
          add an order to the order list
 int getMaxDist()
           
 int getMaxSeats()
           
abstract  Order getOrder(int idx)
          get an order to the order list
abstract  Order[] getOrderList()
          get the current order list
abstract  boolean isEmpty()
          determines if the order list is empty or not
abstract  Order removeOrder(int idx)
          remove an order to the order list
 void setMaxDist(int maxDist)
          Set maximum distance for a delivered order
 void setMaxSeats(int maxSeats)
          Set the maximum number of seats in the restaurant
abstract  int size()
          return the number of orders currently in the list
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DIST

public static final int MAX_DIST
See Also:
Constant Field Values

MAX_SEATS

public static final int MAX_SEATS
See Also:
Constant Field Values
Constructor Detail

OrderList

public OrderList()
Method Detail

getMaxDist

public int getMaxDist()
Returns:
maximum distance for a delivered order

setMaxDist

public void setMaxDist(int maxDist)
Set maximum distance for a delivered order

Parameters:
maxDist -

getMaxSeats

public int getMaxSeats()
Returns:
maximum number of seats in the restaurant

setMaxSeats

public void setMaxSeats(int maxSeats)
Set the maximum number of seats in the restaurant

Parameters:
maxSeats -

addOrder

public abstract void addOrder(Order order,
                              int orderType,
                              int dist,
                              int seats)
                       throws OrderList.UnAcceptanceOrderException
add an order to the order list

Parameters:
order - the order to add to the list
Throws:
FullOrdersException - throw this when there is no more space on the order list
OrderList.UnAcceptanceOrderException

removeOrder

public abstract Order removeOrder(int idx)
                           throws ILinkedList.OrderIndexOutOfBoundsException
remove an order to the order list

Parameters:
idx - the index in the list of the order to remove
Returns:
the order which was removed
Throws:
ILinkedList.OrderIndexOutOfBoundsException - throw this when the index is not valid

getOrder

public abstract Order getOrder(int idx)
                        throws ILinkedList.OrderIndexOutOfBoundsException
get an order to the order list

Parameters:
idx - the index in the list of the order to get
Returns:
the order which was gotten
Throws:
ILinkedList.OrderIndexOutOfBoundsException - throw this when the index is not valid

size

public abstract int size()
return the number of orders currently in the list

Returns:
the number of orders currently in the list

isEmpty

public abstract boolean isEmpty()
determines if the order list is empty or not

Returns:
true of the order list is empty, false otherwise

getOrderList

public abstract Order[] getOrderList()
                              throws OrderList.NoOrderException
get the current order list

Returns:
the order list
Throws:
OrderList.NoOrderException - throw this when there is no order in the list