예제 #1
0
 @Override
 public void remove(String name) throws PresetNotFoundException {
   for (Preset preset : list)
     if (preset.name().equalsIgnoreCase(name)) {
       list.remove(preset);
       return;
     }
   throw new PresetNotFoundException("Preset.id(" + name + ") not found");
 }
예제 #2
0
 @Override
 public List<String> list() {
   List<String> names = new ArrayList<String>();
   for (Preset preset : list) names.add(preset.name());
   return names;
 }
예제 #3
0
 @Override
 public void put(Preset preset) {
   int index = find(preset.name());
   if (index >= 0) list.remove(index);
   list.add(preset);
 }