- java.lang.Object
-
- util.IdNumberUtil
-
public class IdNumberUtil extends java.lang.Object
TheIdNumberUtil
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 Summary
Constructors Constructor Description IdNumberUtil()
Construct an instance ofIdNumberUtil
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
findLowestAvailableCampId(java.util.Map<java.lang.Integer,Camp> campData)
Find the lowest availableCamp
ID integer from a list of campsstatic int
findLowestAvailableEnquiryId(java.util.Map<java.lang.Integer,Enquiry> enquiryData)
Find the lowest availableEnquiry
ID integer from a list of enquiriesstatic int
findLowestAvailableSuggestionId(java.util.Map<java.lang.Integer,Suggestion> suggestionData)
Find the lowest availableSuggestion
ID integer from a list of suggestions
-
-
-
Constructor Detail
-
IdNumberUtil
public IdNumberUtil()
Construct an instance ofIdNumberUtil
-
-
Method Detail
-
findLowestAvailableCampId
public static int findLowestAvailableCampId(java.util.Map<java.lang.Integer,Camp> campData)
Find the lowest availableCamp
ID integer from a list of camps- Parameters:
campData
- theMap
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 availableEnquiry
ID integer from a list of enquiries- Parameters:
enquiryData
- theMap
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 availableSuggestion
ID integer from a list of suggestions- Parameters:
suggestionData
- theMap
object with numeric Suggestion ID key and Suggesion object as value- Returns:
- the lowest Suggestion ID not occupied by an suggestion
-
-