Created
December 20, 2011 05:17
-
-
Save alexduarte/1500365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
public class IHIT extends TemplateDeImpostoCondicional { | |
; | |
public boolean deveUsarMaximaTaxacao(Orcamento orcamento) { | |
return existe(orcamento); | |
} | |
public double maximaTaxacao(Orcamento orcamento) { | |
return orcamento.getValor()*0.13 + 100; | |
} | |
public double minimaTaxacao(Orcamento orcamento) { | |
return orcamento.getValor()*0.01 * orcamento.getItens().size() ; | |
} | |
public boolean existe(Orcamento orcamento){ | |
ArrayList<Item> itens = new ArrayList<Item>(); | |
for(Item item: orcamento.getItens()){ | |
for(int i = 0; i< itens.size(); i++){ | |
if(item.getNome().equals(itens.get(i).getNome())){ | |
itens.add(item); | |
return true; | |
} | |
} | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment