private static void agregaHashJogadoresTotal( File ficheiro_global, String hashjogadores_fut, String hashjogadores_tenis) throws IOException { // TODO Auto-generated method stub String s_final = null; FileReader fr = new FileReader(ficheiro_global); char[] creader = new char[(int) ficheiro_global.length()]; fr.read(creader); s_final = new String(creader); Pattern pattern_fut = Pattern.compile(hashjogadores_fut); Matcher matcher_fut = pattern_fut.matcher(s_final); Pattern pattern_tenis = Pattern.compile(hashjogadores_tenis); Matcher matcher_tenis = pattern_tenis.matcher(s_final); boolean enc_padrao = false; // vector com as ocorrências dos padrões das hashtags de todos os jogadores Vector<String> vec_hashjogadores = new Vector<String>(); // adiciona os padroes de fut while (matcher_fut.find()) { vec_hashjogadores.add(matcher_fut.group()); enc_padrao = true; } // adiciona os padroes de tenis while (matcher_tenis.find()) { vec_hashjogadores.add(matcher_tenis.group()); enc_padrao = true; } // se existir algum padrao de hashtags de jogadores faz as verificações /actualizações se // necessario if (enc_padrao) { for (int i = 0; i != vec_hashjogadores.size(); i++) { VerificaHashJogadoresAppM.verificaDadosHashJogador(vec_hashjogadores.elementAt(i)); } // depois de actualizar a tabela hashjogador verifica a tabela utilizadorhashjogador for (int i = 0; i != vec_hashjogadores.size(); i++) { VerificaHashJogadoresAppM.verificaDadosUtilizadorHashJogador( vec_hashjogadores.elementAt(i)); } // Após inserir/actualizar a tabela utilizadorhashequipa verifica se não ficaram duplicados VerificaHashJogadoresAppM.verificaIdsHashJogador(vec_hashjogadores); } }