コード例 #1
0
ファイル: Driver.java プロジェクト: nicgarner/IBMS
 /**
  * Get all the drivers in the database.
  *
  * @return an array of driver objects
  */
 public static Driver[] get_drivers() {
   int[] driver_ids = DriverInfo.getDrivers();
   Driver[] drivers = new Driver[driver_ids.length];
   for (int driver = 0; driver < drivers.length; driver++)
     drivers[driver] = new Driver(DriverInfo.getNumber(driver_ids[driver]));
   return drivers;
 }
コード例 #2
0
ファイル: Driver.java プロジェクト: nicgarner/IBMS
 /**
  * Instantiates an object representing a driver record in the database.
  *
  * @param id the drivers unique identification number
  */
 public Driver(String id) throws InvalidQueryException {
   try {
     name = DriverInfo.getName(DriverInfo.findDriver(id));
     key = DriverInfo.findDriver(id);
     id_number = Integer.parseInt(id);
   } catch (InvalidQueryException e) {
     throw e;
   }
 }
コード例 #3
0
ファイル: Driver.java プロジェクト: nicgarner/IBMS
 /**
  * Determine whether the driver is available on the specified date.
  *
  * @param date the date to check for availability
  * @return Boolean true for available, else false
  */
 public Boolean available(GregorianCalendar date) {
   return DriverInfo.isAvailable(key, date.getTime());
 }
コード例 #4
0
ファイル: Driver.java プロジェクト: nicgarner/IBMS
 /**
  * Returns the number of days of holiday the driver has booked this year, both in the past as well
  * as the future.
  *
  * @return the number of days of holiday used
  */
 public int holiday_used() {
   return DriverInfo.getHolidaysTaken(key);
 }