Package controleEstoque.estruturaDados

Examples of controleEstoque.estruturaDados.ListaProdutos


    /**
     * Método que carrega a lista de produtos direto do bloco de notas
     * @return a Lista completa com todos arquivos salvos
     */
    public ListaProdutos carregaListaProdutos(){
        ListaProdutos lista = new ListaProdutos();
       
        if(verificaArquivo()){
            try {               
                BufferedReader bufReader = new BufferedReader(new FileReader(file));
                String strReader = bufReader.readLine();
                int i = 0;               
                Produto produto = new Produto();
                Estoque estoque = new Estoque();
                Estatisticas estatistica = new Estatisticas();
               
                while(strReader != null){
                    switch (i){
                        case 0:                           
                            produto.setId(Integer.parseInt(strReader));                          
                        break;
                           
                        case 1:                           
                            produto.setNome(strReader);                          
                        break;
                           
                        case 2:
                           produto.setDescricao(strReader);                                                  
                        break;
                           
                        case 3:
                            produto.setValorUnitario(Double.parseDouble(strReader));
                        break;
                           
                        case 4:
                            estatistica.setVendaMediaMensal(Double.parseDouble(strReader));
                        break;  
                           
                        case 5:
                            estatistica.setTempoCobertura(Double.parseDouble(strReader));
                        break;  
                           
                        case 6:
                            estatistica.setEstoqueMinimo(Integer.parseInt(strReader));
                        break;  
                           
                        case 7:
                            estatistica.setEstoqueMaximo(Integer.parseInt(strReader));                                                      
                        break;                              
                           
                       case 8:
                            estoque.setQuantidade(Integer.parseInt(strReader));
                        break;       
                    }
                  i++;
                  if(i == 9){
                      estoque.setEstatistica(estatistica);
                      produto.setEstoque(estoque);
                      lista.adiciona(produto);
                      i = 0;
                  }
                     
                  strReader = bufReader.readLine();
                }
View Full Code Here


     * Construtor de instancia padrĂ£o ("" e null)
     */
    public Fornecedor() {
        this.nome = "";
        this.telefone = "";
        this.produtos = new ListaProdutos();
    }
View Full Code Here

TOP

Related Classes of controleEstoque.estruturaDados.ListaProdutos

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.