Se vc usar o keySet, vai ter que, pra cada chave, buscar o valor no mapa para então comparar. Se vc usar o entrySet, já terá um objeto com métodos getKey e getValue. Assim vc pode só comparar os Values e quando for igual, retornar o Key daquele objeto. Bem mais simples.
Abraço Peter P. Lupo http://craftnicely.blogspot.com - http://sites.google.com/site/pplupo MPS.BR Authorized Implementation Practitioner - Certified ScrumMaster Sun Certified Java Associate - Java Brown Belt +55 (021) 81742487 2010/6/6 Romulo Freires <[email protected]> > Use o metodo keySet(), tendo as chaves você pode achar os feriados. > > Daí você só precisa saber se eles são iguais ao feriado dado. > > Não esqueça que esse método retorna uma Data. > > Em 6 de junho de 2010 01:07, Peter P. Lupo <[email protected]> escreveu: > > Ou pegar a coleção de Entry<Chave, Valor> (entrySet();) comparando os >> valores e retornando a chave. ;-) >> >> Abraço >> >> Peter P. Lupo >> http://craftnicely.blogspot.com - http://sites.google.com/site/pplupo >> MPS.BR Authorized Implementation Practitioner - Certified ScrumMaster >> Sun Certified Java Associate - Java Brown Belt >> +55 (021) 81742487 >> >> >> 2010/6/6 Miguel Jonathan <[email protected]> >> >> A sua pergunta está meio confusa, Daniel. >>> Você quer dizer o método procuraFeriado, e não o construtor, certo? >>> Você tem que obter o set das chaves do map, e depois iterar sobre esse >>> set, e para cada elemento do set verificar se o valor correspondente no map >>> é o feriado procurado. >>> >>> abs, >>> Jonathan >>> >>> 2010/6/5 Daniel Daim <[email protected]> >>> >>>> Estou com dificuldades de fazer o construtor procurarFeriado. >>>> >>>> Como que eu pego o a chave a partir do valor dela? Estava vendo a a >>>> classe Map e só tem um método que você passa como parâmetro o valor, mas o >>>> tipo de retorno é booleano. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Comp 2 - Geral" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<comp2-geral%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/comp2-geral?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Comp 2 - Geral" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<comp2-geral%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/comp2-geral?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Comp 2 - Geral" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<comp2-geral%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/comp2-geral?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Comp 2 - Geral" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<comp2-geral%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/comp2-geral?hl=en. > -- You received this message because you are subscribed to the Google Groups "Comp 2 - Geral" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/comp2-geral?hl=en.
