/** * Tells when the item at the front of the ConveyorBelt queue will depart that queue and * subsequently enter a ShipmentProcessStation queue. If the queue is empty, return * Integer.MAX_VALUE. * * @return int departTime time when the item at the front of the conveyor belt will depart. */ public int departTimeNext() { int departTime = Integer.MAX_VALUE; if (!queueFromFactory.isEmpty()) { ItemToShip item = queueFromFactory.front(); departTime = item.getArrivalTime(); } return departTime; }
/** * Returns true if ShipmentQueue is not empty * * @return boolean true of ShipmentQueue is not empty */ public boolean hasNext() { return (!queueFromFactory.isEmpty()); }