Package util

Class IdNumberUtil


  • public class IdNumberUtil
    extends java.lang.Object
    The IdNumberUtil class provide utility functions that find the lowest available ID integer for Camp, Enquiry, and Suggestion so that the new object created will take the lowest available ID
    • Constructor Detail

      • IdNumberUtil

        public IdNumberUtil()
        Construct an instance of IdNumberUtil
    • Method Detail

      • findLowestAvailableCampId

        public static int findLowestAvailableCampId​(java.util.Map<java.lang.Integer,​Camp> campData)
        Find the lowest available Camp ID integer from a list of camps
        Parameters:
        campData - the Map object with numeric Camp ID key and Camp object as value
        Returns:
        the lowest Camp ID not occupied by a camp
      • findLowestAvailableEnquiryId

        public static int findLowestAvailableEnquiryId​(java.util.Map<java.lang.Integer,​Enquiry> enquiryData)
        Find the lowest available Enquiry ID integer from a list of enquiries
        Parameters:
        enquiryData - the Map object with numeric Enquiry ID key and Enquiry object as value
        Returns:
        the lowest Enquiry ID not occupied by an enquiry
      • findLowestAvailableSuggestionId

        public static int findLowestAvailableSuggestionId​(java.util.Map<java.lang.Integer,​Suggestion> suggestionData)
        Find the lowest available Suggestion ID integer from a list of suggestions
        Parameters:
        suggestionData - the Map object with numeric Suggestion ID key and Suggesion object as value
        Returns:
        the lowest Suggestion ID not occupied by an suggestion