public void generatePotentialMenuTimes(ArrayList<LocalTime> desiredTimes){
  potentialMenuTimes=new ArrayList<LocalTime>();
  if (desiredTimes == null || desiredTimes.isEmpty()) {
    return;
  }
  TreeSet<LocalTime> timeSet=new TreeSet<LocalTime>();
  for (  LocalTime desiredTime : desiredTimes) {
    if (desiredTime != null) {
      timeSet.add(desiredTime);
    }
  }
  for (  LocalTime timeSetEntry : timeSet) {
    potentialMenuTimes.add(timeSetEntry);
  }
}

public void generatePotentialMenuTimes ( ArrayList < LocalTime > desiredTimes ) { potentialMenuTimes = new ArrayList < LocalTime > ( ) ; if ( desiredTimes == null || desiredTimes . isEmpty ( ) ) { return ; } TreeSet < LocalTime > timeSet = new TreeSet < LocalTime > ( ) ; for ( LocalTime desiredTime : desiredTimes ) { if ( desiredTime != null ) { timeSet . add ( desiredTime ) ; } } for ( LocalTime timeSetEntry : timeSet ) { potentialMenuTimes . add ( timeSetEntry ) ; } }
generatepotentialmenutimes , this will generate the menu times for populating the combo box menu , using the items from a list of localtime instances . the list will be sorted and cleaned of duplicates before use . null values and duplicate values will not be added . when this function is complete , the menu will contain one instance of each unique localtime that was supplied to this function , in ascending order going from midnight to 11 . 59pm . the drop down menu will not contain any time values except those supplied in the desiredtimes list . note : this function can be called before or after setting an optional veto policy . vetoed times will never be added to the time picker menu , regardless of whether they are generated by this function .
