private void readAvailabilityTable ( Resource resource , AvailabilityPeriods periods ) { if ( periods != null ) { AvailabilityTable table = resource . getAvailability ( ) ; List < AvailabilityPeriod > list = periods . getAvailabilityPeriod ( ) ; for ( AvailabilityPeriod period : list ) { Date start = period . getAvailableFrom ( ) ; Date end = period . getAvailableTo ( ) ; Number units = DatatypeConverter . parseUnits ( period . getAvailableUnits ( ) ) ; Availability availability = new Availability ( start , end , units ) ; table . add ( availability ) ; } Collections . sort ( table ) ; } }
Reads the availability table from the file .