package br.edu.ifba.ads.mediaCenter.util;

import br.edu.ifba.ads.mediaCenter.exceptions.BuscavelNaoEncontradoException;

public class Buscador{
  
    public Buscavel buscar(Buscavel[] buscaveis, Object id) throws BuscavelNaoEncontradoException{
        for(Buscavel b : buscaveis)
            if(b.ehChave(id))
              return b;
		throw new BuscavelNaoEncontradoException(id);
    }    
}
