コード例 #1
0
ファイル: ControladorTime.java プロジェクト: hjvsantos/Joga10
 public void atualizarTime(Time time) throws TimeNaoEncontradoException, IllegalArgumentException {
   Time t;
   int index;
   if (time != null) {
     t = repositorioTime.retornarTime(time.getUsuario());
     index = repositorioTime.procurarIndice(time);
   } else {
     throw new IllegalArgumentException();
   }
   if (index != -1 && t != null) {
     repositorioTime.atualizarTime(t, index);
   } else {
     throw new TimeNaoEncontradoException();
   }
 }
コード例 #2
0
ファイル: ControladorTime.java プロジェクト: hjvsantos/Joga10
 public void removerTime(Time time) throws UsuarioNaoEncontradoException {
   // List<Olheiro> olheirosContratados = null;
   if (time != null) {
     int index = repositorioTime.procurarIndice(time);
     if (index != -1) {
       /*	TimesASeremRemovidos = repositorioTime
       if (TimesASeremRemovidos != null){
       	for (Time t: TimesASeremRemovidos){
       		repositorioTime.removerTime(t);
       	}
       }*/
       repositorioTime.removerTime(time);
     } else throw new UsuarioNaoEncontradoException();
   } else {
     throw new IllegalArgumentException();
   }
 }