(int spotNumber, Vehicle vehicle)
| 44 | |
| 45 | /* Park a vehicle starting at the spot spotNumber, and continuing until vehicle.spotsNeeded. */ |
| 46 | private boolean parkStartingAtSpot(int spotNumber, Vehicle vehicle) { |
| 47 | vehicle.clearSpots(); |
| 48 | boolean success = true; |
| 49 | for (int i = spotNumber; i < spotNumber + vehicle.spotsNeeded; i++) { |
| 50 | success &= spots[i].park(vehicle); |
| 51 | } |
| 52 | availableSpots -= vehicle.spotsNeeded; |
| 53 | return success; |
| 54 | } |
| 55 | |
| 56 | /* find a spot to park this vehicle. Return index of spot, or -1 on failure. */ |
| 57 | private int findAvailableSpots(Vehicle vehicle) { |
no test coverage detected