/** * Return particular vehicle from company's resources. * * @param ID vehicle ID * @return selected vehicle on success, null otherwise */ public MeanOfTransport getMeanOfTransport(int ID) { for (MeanOfTransport mot : m_availableMeansOfTransport) if (mot.getID() == ID) return mot; return null; }
/** * Add mean of transport to the company's resources. * * @param mot vehicle to be added */ public void addMeanOfTransport(MeanOfTransport mot) { mot.setID(getNextID()); m_availableMeansOfTransport.add(mot); }